14 #define RADIANS(x) ((x)*TMath::Pi()/180.0)
16 #ifndef _EIC_TRACKING_DIGI_HIT_PRODUCER_
17 #define _EIC_TRACKING_DIGI_HIT_PRODUCER_
41 double gra[])
const = 0;
44 unsigned iq)
const = 0;
45 virtual void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
46 const std::set<double> &xMax,
47 const std::set<double> &yMin,
const std::set<double> &yMax,
48 const std::set<double> &rMin,
const std::set<double> &rMax,
49 double min[],
double max[])
const = 0;
51 virtual unsigned GetMdim()
const = 0;
52 virtual double GetSigma(
unsigned iq)
const = 0;
53 virtual double GetPitch(
unsigned iq)
const = 0;
85 TVector3 vv(0.0, 0.0, 0.0);
87 for(
unsigned xy=0; xy<
GetMdim(); xy++)
88 vv[xy] = tmplCoord[xy];
93 for(
unsigned xy=0; xy<
GetMdim(); xy++)
94 tmplCoord[xy] = crs[xy];
104 switch (smearing_model) {
113 assert(0);
return 0.0;
120 const TString &detName,
123 TVector3 &local) = 0;
127 const TString &detName,
163 const TString &detName,
168 new((*arr)[arr->GetEntriesFast()])
195 double aGranularity,
double gra[])
const {
196 gra[0] = spGranularity;
202 return (iq ? 0.0 : spSmearing);
204 void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
const std::set<double> &xMax,
205 const std::set<double> &yMin,
const std::set<double> &yMax,
206 const std::set<double> &rMin,
const std::set<double> &rMax,
207 double min[],
double max[])
const {
208 min[0] = *xMin.begin();
209 max[0] = *xMax.rbegin();
235 double aGranularity,
double gra[])
const {
236 gra[0] = spGranularity;
242 return (iq ? 0.0 : spSmearing);
244 void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
const std::set<double> &xMax,
245 const std::set<double> &yMin,
const std::set<double> &yMax,
246 const std::set<double> &rMin,
const std::set<double> &rMax,
247 double min[],
double max[])
const {
249 max[0] = *rMax.rbegin();
260 TVector3 vv(0.0, 0.0, 0.0);
263 double r = tmplCoord[0],
phi = 0.0;
264 vv[0] = r*
cos(phi); vv[1] = r*sin(phi);
269 double x = crs[0],
y = crs[1];
270 tmplCoord[0] = sqrt(x*x+y*y);
287 double aGranularity,
double gra[])
const {
288 gra[0] = aGranularity;
297 void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
const std::set<double> &xMax,
298 const std::set<double> &yMin,
const std::set<double> &yMax,
299 const std::set<double> &rMin,
const std::set<double> &rMax,
300 double min[],
double max[])
const {
301 min[0] = -TMath::Pi();
302 max[0] = TMath::Pi();
305 TVector3 vv(0.0, 0.0, 0.0);
308 double r = 1.0,
phi = tmplCoord[0];
317 double x = crs[0],
y = crs[1];
318 tmplCoord[0] = atan2(y, x);
351 double aGranularity,
double gra[])
const {
352 gra[0] = spGranularity;
353 gra[1] = useCartesian ? spGranularity : aGranularity;
355 void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
const std::set<double> &xMax,
356 const std::set<double> &yMin,
const std::set<double> &yMax,
357 const std::set<double> &rMin,
const std::set<double> &rMax,
358 double min[],
double max[])
const {
361 min[0] = *xMin.begin();
362 max[0] = *xMax.rbegin();
363 min[1] = *yMin.begin();
364 max[1] = *yMax.rbegin();
367 max[0] = *rMax.rbegin();
369 min[1] = -TMath::Pi();
370 max[1] = TMath::Pi();
376 const TString &detName,
380 new((*arr)[arr->GetEntriesFast()])
387 double x = crs[0],
y = crs[1], r = sqrt(x*x+y*y);
388 double phi = atan2(y, x);
409 for(
unsigned xy=0; xy<2; xy++)
440 TVector3 uu = TVector3(local.Y(),-local.X(),0).Unit();
443 local += smeared_value * uu;
450 return (iq <= 1 ? spSmearing : 0.0);
483 TVector3 vv(0.0, 0.0, 0.0);
485 double r = tmplCoord[0],
phi = tmplCoord[1];
494 vv[0] = r*
cos(phi); vv[1] = r*sin(phi);
516 const TString &detName,
550 double GetPitch(
unsigned iq)
const { assert(0);
return 0.0; };
554 double aGranularity,
double gra[])
const {
558 assert(0);
return 0.0;
560 void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
const std::set<double> &xMax,
561 const std::set<double> &yMin,
const std::set<double> &yMax,
562 const std::set<double> &rMin,
const std::set<double> &rMax,
563 double min[],
double max[])
const {
574 const TString &detName,
583 double localCoord[],
double localDirection[], TVector3 &global) {
588 double localCov[3][3];
589 memset(localCov, 0x00,
sizeof(localCov));
590 for(
int iq=0; iq<3; iq++)
593 TVector3 vCoord = TVector3(localCoord);
594 new((*arr)[arr->GetEntriesFast()])
603 void SetSigma(
double sigmaX,
double sigmaY,
double sigmaZ) {
622 EicKfNodeTemplateAxial3D(TGeoMatrix *transformation = 0):
EicKfNodeTemplate(transformation) {
623 mSigmaL = mSigmaT = 0.0;
625 ~EicKfNodeTemplateAxial3D() {};
627 unsigned GetMdim()
const {
return 3; };
629 double GetSigma(
unsigned iq)
const {
640 double GetPitch(
unsigned iq)
const { assert(0); };
644 TVector3 &local,
double localDirection[], TVector3 &global) {
652 double aGranularity,
double gra[])
const {
656 assert(0);
return 0.0;
658 void FillMinMaxArrays(
bool useCartesian,
const std::set<double> &xMin,
const std::set<double> &xMax,
659 const std::set<double> &yMin,
const std::set<double> &yMax,
660 const std::set<double> &rMin,
const std::set<double> &rMax,
661 double min[],
double max[])
const {
667 const TString &detName,
669 TVector3 &local,
double localDirection[], TVector3 &global) {
670 ConvertLocalCoordInPlace(localCoord);
678 TVector3 zLocal(0.0, 0.0, 1.0), zAxis(localDirection[0], localDirection[1], localDirection[2]);
679 TVector3 xAxis = (zLocal.Cross(zAxis)).Unit(), yAxis = zAxis.Cross(xAxis);
681 double data[3][3] = {{xAxis.X(), yAxis.X(), zAxis.X()},
682 {xAxis.Y(), yAxis.Y(), zAxis.Y()},
683 {xAxis.Z(), yAxis.Z(), zAxis.Z()}};
685 grr.SetMatrix((
double*)data);
689 double rotatedCoord[3];
690 grr.MasterToLocal(localCoord, rotatedCoord);
692 printf(
"loc(xx): %f %f %f\n", localCoord [0], localCoord [1], localCoord [2]);
693 printf(
"rot(xx): %f %f %f\n", rotatedCoord[0], rotatedCoord[1], rotatedCoord[2]);
696 grr.MasterToLocalVect(localDirection, bff);
697 printf(
"loc(nn): %f %f %f\n", localDirection [0], localDirection [1], localDirection [2]);
698 printf(
"rot(nn): %f %f %f\n\n", bff[0], bff[1], bff[2]);
704 double qsigma[3] = {mSigmaT, mSigmaT, mSigmaL};
710 for(
int iq=0; iq<3; iq++)
711 rotatedCoord[iq] += gRandom->Gaus(0.0, qsigma[iq]);
715 grr.LocalToMaster(rotatedCoord, localCoord);
719 double rotatedCov[3][3], localCov[3][3];
720 memset(rotatedCov, 0x00,
sizeof(rotatedCov));
721 for(
int iq=0; iq<3; iq++)
722 rotatedCov[iq][iq] = qsigma[iq] * qsigma[iq];
724 memset(localCov, 0x00,
sizeof(localCov));
726 for(
unsigned ip=0;
ip<3;
ip++)
727 for(
unsigned ir=0;
ir<3;
ir++)
728 for(
unsigned is=0; is<3; is++)
729 for(
unsigned iq=0; iq<3; iq++)
731 localCov[
ip][iq] += data[
ip][
ir] * rotatedCov[
ir][is] * data[iq][is];
733 new((*arr)[arr->GetEntriesFast()])
742 void ThreeDeeToTemplate(
const TVector3 &crs,
double tmplCoord[])
const { assert(0); };
745 void SetSigma(
double sigmaL,
double sigmaT) {
746 mSigmaL = sigmaL; mSigmaT = sigmaT;
754 ClassDef(EicKfNodeTemplateAxial3D,1)
776 mtx =
new TGeoRotation();
813 double sigmaOrPitchA) {
826 node->
SetSigma(sigmaX, sigmaY, sigmaZ);
832 void DefineKfNodeTemplateAxial3D(
double sigmaL,
double sigmaT) {
833 EicKfNodeTemplateAxial3D *node =
new EicKfNodeTemplateAxial3D();
837 node->SetSigma(sigmaL, sigmaT);
860 " hit classes (%s & %s)! Not suported yet ... \033[0m",
893 double sigmaOrPitch1,
double sigmaOrPitch2) {
895 node->
SetSigma(sigmaOrPitch1, sigmaOrPitch2) : node->
SetPitch(sigmaOrPitch1, sigmaOrPitch2);