FEDRA emulsion software from the OPERA Collaboration
EdbPlateTracking Class Reference

#include <EdbPlateTracking.h>

Inheritance diagram for EdbPlateTracking:
Collaboration diagram for EdbPlateTracking:

Public Member Functions

 EdbPlateTracking ()
 
 EdbPlateTracking (EdbPattern &S1, EdbPattern &S2, EdbSegP &prediction)
 
 EdbPlateTracking (EdbPattern &S1, EdbPattern &S2, EdbSegP &prediction, EdbPlateP &plate)
 
int ExtrapolateCond (EdbScanCond &inputcond, int flag, EdbScanCond &outputcond)
 
int FindBestCandidate (EdbPattern &fndbt, EdbSegP &fnd, EdbPattern &cnd, float wmin, float wmindegrad, float chi2max)
 
int FindBestCandidateDS (EdbPattern &fndbt, EdbSegP &fnd, EdbPattern &cnd, float wmin, float wmindegrad, float chi2max, EdbSegP &spred, float maxdmin)
 
int FindCandidateMT (EdbPattern &fnds1, EdbPattern &fnds2, EdbSegP &fnd)
 
int FindCandidateMTDS (EdbPattern &fnds1, EdbPattern &fnds2, EdbSegP &fnd, EdbSegP &spred, float maxdmin)
 
int FindCandidates (EdbSegP &spred, EdbPattern &fndbt, EdbPattern &fnds1, EdbPattern &fnds2)
 
int FindCompliments (EdbSegP &s, EdbPattern &pat, TObjArray &found, float chi2max, TArrayF &chiarr)
 
int FindPrediction (EdbSegP &spred, EdbSegP &fndbt, EdbSegP &fnds1, EdbSegP &fnds2, EdbSegP &snewpred)
 
int FindPredictionDS (EdbSegP &spred, EdbSegP &fndbt, EdbSegP &fnds1, EdbSegP &fnds2, EdbSegP &snewpred, float maxdmin)
 
int FindTrack (EdbTrackP &pred, EdbTrackP &found, EdbPlateP &plate)
 
bool GetSBtreeEntry (int entry, TTree &tsbt)
 
void Print ()
 
void Set0 ()
 
void SetCondBT (EdbScanCond &cond)
 
void SetCondMT (EdbScanCond &cond)
 
void SetPred (const EdbSegP &pred)
 
void TransformFromPlateRS ()
 
int UpdateFlag (int flag, int status)
 
bool UpdateSBtree (TTree &tsbt, int idp[4], int idf[4])
 
virtual ~EdbPlateTracking ()
 

Static Public Member Functions

static void CloseSBtree (TTree *tree)
 
static int GetBTHoles (int flag)
 
static int GetMTHoles (int flag)
 
static TTree * InitSBtree (const char *file_name="sbt.root", const char *mode="RECREATE")
 

Public Attributes

Float_t eChi2MaxBT
 
Float_t eChi2MaxMT
 
EdbScanCond eCondBT
 
EdbScanCond eCondMT
 
Float_t eDegradPos
 
Float_t eDegradSlope
 
Float_t eDeltaR
 
Int_t eIdf [4]
 
Int_t eIdp [4]
 
EdbSegP eNext
 
EdbPlateP ePlate
 
EdbSegP ePred
 
bool ePredictionScan
 
Float_t ePreliminaryChi2MaxMT
 
Float_t ePulsMinBT
 
Float_t ePulsMinDegradBT
 
Float_t ePulsMinDegradMT
 
Float_t ePulsMinMT
 
EdbSegP eS
 
EdbSegP eS1
 
EdbPattern eS1cnd
 
EdbPattern eS1pre
 
EdbSegP eS2
 
EdbPattern eS2cnd
 
EdbPattern eS2pre
 
EdbPattern eScnd
 
EdbPattern eSide1
 
EdbPattern eSide2
 
EdbPattern eSpre
 
Int_t eStatus
 

Constructor & Destructor Documentation

◆ EdbPlateTracking() [1/3]

EdbPlateTracking::EdbPlateTracking ( )
inline
77  {
78  Set0();
79  };
void Set0()
Definition: EdbPlateTracking.cxx:27

◆ EdbPlateTracking() [2/3]

EdbPlateTracking::EdbPlateTracking ( EdbPattern S1,
EdbPattern S2,
EdbSegP prediction,
EdbPlateP plate 
)
inline
82  {
83 
84  for(int i=0;i<S1.N();i++)
85  eSide1.AddSegment(*(S1.GetSegment(i)));
86  for(int i=0;i<S2.N();i++)
87  eSide2.AddSegment(*(S2.GetSegment(i)));
88 
89  eSide1.SetZ(S1.Z());
90  eSide2.SetZ(S2.Z());
91 
92  ePred.Copy(prediction);
93  ePlate.Copy(plate);
94  Set0();
95  };
void Copy(EdbPlateP &p)
Definition: EdbBrick.cxx:22
EdbPattern eSide1
Definition: EdbPlateTracking.h:26
EdbPlateP ePlate
Definition: EdbPlateTracking.h:28
EdbSegP ePred
Definition: EdbPlateTracking.h:25
EdbPattern eSide2
Definition: EdbPlateTracking.h:27
void Copy(const EdbSegP &s)
Definition: EdbSegP.cxx:104
Float_t Z() const
Definition: EdbPattern.h:87
void SetZ(float z)
Definition: EdbPattern.h:41
Int_t N() const
Definition: EdbPattern.h:89
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
EdbSegP * AddSegment(int i, EdbSegP &s)
Definition: EdbPattern.cxx:71
Int_t plate
Definition: merge_Energy_SytematicSources_Electron.C:1

◆ EdbPlateTracking() [3/3]

EdbPlateTracking::EdbPlateTracking ( EdbPattern S1,
EdbPattern S2,
EdbSegP prediction 
)
inline
98  {
99 
100  for(int i=0;i<S1.N();i++)
101  eSide1.AddSegment(*(S1.GetSegment(i)));
102  for(int i=0;i<S2.N();i++)
103  eSide2.AddSegment(*(S2.GetSegment(i)));
104 
105  eSide1.SetZ(S1.Z());
106  eSide2.SetZ(S2.Z());
107 
108  ePred.Copy(prediction);
109  Set0();
110  };

◆ ~EdbPlateTracking()

virtual EdbPlateTracking::~EdbPlateTracking ( )
virtual

Member Function Documentation

◆ CloseSBtree()

void EdbPlateTracking::CloseSBtree ( TTree *  tree)
static
743 {
744  tree->AutoSave();
745  TFile *f=0;
746  f = tree->GetCurrentFile();
747  if(f) {
748  f->Purge();
749  f->Close();
750  }
751  tree=0;
752 }
FILE * f
Definition: RecDispMC.C:150

◆ ExtrapolateCond()

int EdbPlateTracking::ExtrapolateCond ( EdbScanCond inputcond,
int  flag,
EdbScanCond outputcond 
)
108 {
109  // TODO: tuning the dependency of sigma
110  // NOTED by Artem: when we do jumping we have no "holes" stored in the flag, so this function do not
111  // extrapolate errors correctly so one had to encrease the acceptance manually,
112  // possible solution can be to add total plates number before the last found
113  // track into the flag and use it only for extrapolation
114 
115  int bth = GetBTHoles(flag);
116  int mth = GetMTHoles(flag);
117  outputcond = inputcond;
118  outputcond.SetSigma0( inputcond.SigmaX(0) + eDegradPos * mth,
119  inputcond.SigmaY(0) + eDegradPos * mth,
120  inputcond.SigmaTX(0) + eDegradSlope * bth,
121  inputcond.SigmaTY(0) + eDegradSlope * bth );
122  return(0);
123 }
static int GetBTHoles(int flag)
Definition: EdbPlateTracking.h:121
Float_t eDegradSlope
Definition: EdbPlateTracking.h:67
Float_t eDegradPos
Definition: EdbPlateTracking.h:66
static int GetMTHoles(int flag)
Definition: EdbPlateTracking.h:122
float SigmaTX(float ax) const
Definition: EdbScanCond.h:106
float SigmaTY(float ay) const
Definition: EdbScanCond.h:107
float SigmaX(float ax) const
Definition: EdbScanCond.h:102
void SetSigma0(float x, float y, float tx, float ty)
Definition: EdbScanCond.h:62
float SigmaY(float ay) const
Definition: EdbScanCond.h:103

◆ FindBestCandidate()

int EdbPlateTracking::FindBestCandidate ( EdbPattern fndbt,
EdbSegP fnd,
EdbPattern cnd,
float  wmin,
float  wmindegrad,
float  chi2max 
)
322 {
323  int n=0;
324  fnd.Set0();
325  fnd.SetChi2(10000.+chi2max);
326  for (int i=0; i<cand.N(); i++) {
327  EdbSegP *s = cand.GetSegment(i);
328  if ( s->W()<wmin+s->Chi2()*wmindegrad ) continue;
329  if ( s->Chi2()>chi2max ) continue;
330  n++;
331  passed.AddSegment(*s);
332  if (s->Chi2()<fnd.Chi2()) fnd.Copy(*s);
333  }
334  return n;
335 }
Definition: EdbSegP.h:18
Float_t Chi2() const
Definition: EdbSegP.h:154
void SetChi2(float chi2)
Definition: EdbSegP.h:132
Float_t W() const
Definition: EdbSegP.h:148
void Set0()
Definition: EdbSegP.cxx:29
EdbSegP * s
Definition: tlg2pattern.C:32

◆ FindBestCandidateDS()

int EdbPlateTracking::FindBestCandidateDS ( EdbPattern fndbt,
EdbSegP fnd,
EdbPattern cnd,
float  wmin,
float  wmindegrad,
float  chi2max,
EdbSegP spred,
float  maxdmin = 1. 
)
474 {
475  int n=0;
476 
477  float eX1=spred.X(),eY1=spred.Y(),eZ1=spred.Z(),eTX1=spred.TX(),eTY1=spred.TY(),dminz;
478  float s1,s2,s1bunsi,s1bunbo,s2bunsi,s2bunbo;
479  float p1x,p1y,p1z,p2x,p2y,p2z,p1p2;
480 
481  fnd.Set0();
482  fnd.SetChi2(10000.+chi2max);
483 
484  for (int i=0; i<cand.N(); i++) {
485  EdbSegP *s = cand.GetSegment(i);
486  float eX2=s->X(),eY2=s->Y(),eZ2=s->Z(),eTX2=s->TX(),eTY2=s->TY();
487 
488  s1bunsi=(eTX2*eTX2+eTY2*eTY2+1)*(eTX1*(eX2-eX1)+eTY1*(eY2-eY1)+eZ2-eZ1) - (eTX1*eTX2+eTY1*eTY2+1)*(eTX2*(eX2-eX1)+eTY2*(eY2-eY1)+eZ2-eZ1);
489  s1bunbo=(eTX1*eTX1+eTY1*eTY1+1)*(eTX2*eTX2+eTY2*eTY2+1) - (eTX1*eTX2+eTY1*eTY2+1)*(eTX1*eTX2+eTY1*eTY2+1);
490  s2bunsi=(eTX1*eTX2+eTY1*eTY2+1)*(eTX1*(eX2-eX1)+eTY1*(eY2-eY1)+eZ2-eZ1) - (eTX1*eTX1+eTY1*eTY1+1)*(eTX2*(eX2-eX1)+eTY2*(eY2-eY1)+eZ2-eZ1);
491  s2bunbo=(eTX1*eTX1+eTY1*eTY1+1)*(eTX2*eTX2+eTY2*eTY2+1) - (eTX1*eTX2+eTY1*eTY2+1)*(eTX1*eTX2+eTY1*eTY2+1);
492  s1=s1bunsi/s1bunbo;
493  s2=s2bunsi/s2bunbo;
494  p1x=eX1+s1*eTX1;
495  p1y=eY1+s1*eTY1;
496  p1z=eZ1+s1*1;
497  p2x=eX2+s2*eTX2;
498  p2y=eY2+s2*eTY2;
499  p2z=eZ2+s2*1;
500  p1p2=sqrt( (p1x-p2x)*(p1x-p2x)+(p1y-p2y)*(p1y-p2y)+(p1z-p2z)*(p1z-p2z) );
501  dminz = eZ1-p1z;
502 
503  if (p1p2>maxdmin) continue;
504 
505  if ( s->W()<wmin+s->Chi2()*wmindegrad ) continue;
506  if ( s->Chi2()>chi2max ) continue;
507  n++;
508  passed.AddSegment(*s);
509  if (s->Chi2()<fnd.Chi2()) fnd.Copy(*s);
510  }
511 
512  return n;
513 }
Float_t TX() const
Definition: EdbSegP.h:172
Float_t X() const
Definition: EdbSegP.h:170
Float_t Z() const
Definition: EdbSegP.h:150
Float_t Y() const
Definition: EdbSegP.h:171
Float_t TY() const
Definition: EdbSegP.h:173
EdbSegP * s1
Definition: tlg2pattern.C:30
EdbSegP * s2
Definition: tlg2pattern.C:31

◆ FindCandidateMT()

int EdbPlateTracking::FindCandidateMT ( EdbPattern fnds1,
EdbPattern fnds2,
EdbSegP fnd 
)
301 {
302  EdbSegP s1,s2;
305  // Log(2,"FindCandidateMT","Found %d+%d microtrack candidates after cuts",n1,n2);
306 
307  if( n1==0&&n2==0 ) return 0;
308 
309  if( s1.Chi2() <= s2.Chi2() ) {
310  fnd.Copy(s1);
311  return 1;
312  }
313  else {
314  fnd.Copy(s2);
315  return 2;
316  }
317  return 0;
318 }
int FindBestCandidate(EdbPattern &fndbt, EdbSegP &fnd, EdbPattern &cnd, float wmin, float wmindegrad, float chi2max)
Definition: EdbPlateTracking.cxx:321
Float_t eChi2MaxMT
Definition: EdbPlateTracking.h:61
EdbPattern eS1cnd
Definition: EdbPlateTracking.h:63
Float_t ePulsMinMT
Definition: EdbPlateTracking.h:59
EdbPattern eS2cnd
Definition: EdbPlateTracking.h:64
Float_t ePulsMinDegradMT
Definition: EdbPlateTracking.h:54

◆ FindCandidateMTDS()

int EdbPlateTracking::FindCandidateMTDS ( EdbPattern fnds1,
EdbPattern fnds2,
EdbSegP fnd,
EdbSegP spred,
float  maxdmin = 1. 
)
451 {
452  EdbSegP s1,s2;
453 
454  int n1=FindBestCandidateDS( fnds1, s1, eS1cnd, ePulsMinMT, ePulsMinDegradMT, eChi2MaxMT, spred, maxdmin);
455  int n2=FindBestCandidateDS( fnds2, s2, eS2cnd, ePulsMinMT, ePulsMinDegradMT, eChi2MaxMT, spred, maxdmin);
456 
457  // Log(2,"FindCandidateMTDS","Found %d+%d microtrack candidates after cuts",n1,n2);
458 
459  if( n1==0&&n2==0 ) return 0;
460 
461  if( s1.Chi2() <= s2.Chi2() ) {
462  fnd.Copy(s1);
463  return 1;
464  }
465  else {
466  fnd.Copy(s2);
467  return 2;
468  }
469  return 0;
470 }
int FindBestCandidateDS(EdbPattern &fndbt, EdbSegP &fnd, EdbPattern &cnd, float wmin, float wmindegrad, float chi2max, EdbSegP &spred, float maxdmin)
Definition: EdbPlateTracking.cxx:473

◆ FindCandidates()

int EdbPlateTracking::FindCandidates ( EdbSegP spred,
EdbPattern fndbt,
EdbPattern fnds1,
EdbPattern fnds2 
)
172 {
173  // Find microtracks and basetracks for the prediction segment "spred"
174  // Selection criteria:
175  // 1) select all microtracks with (puls >= ePreliminaryPulsMinMT) (6) and (chi2 < ePreliminaryChi2MaxMT) for both side
176  // 2) select all basetracks by using the selected microtracks, with (chi2_bt < eChi2MaxBT)
177  // Microtracks and basetracks in output are sorted according to chi2 (ascending order = the first one is the best one)
178  //
179  // Input:
180  // spred - track prediction
181  // Output:
182  // fnds1 - microtracks having puls>=ePreliminaryPulsMinMT and chi2<ePreliminaryChi2MaxMT
183  // in the top side of the emulsion plate
184  // fnds2 - microtracks having puls>=ePreliminaryPulsMinMT and chi2<ePreliminaryChi2MaxMT
185  // in the bottom side of the emulsion plate
186  // fndbt - basetracks built from the microtracks and (chi2_bt < eChi2MaxBT)
187 
188 
189  EdbScanCond condBT;
190  ExtrapolateCond(eCondBT,spred.Flag(),condBT);
191  if (gEDBDEBUGLEVEL>=3) condBT.Print();
192 
193  //spred.SetZ(107.); // TODO! sonoqui
194  spred.SetErrors();
195  condBT.FillErrorsCov( spred.TX(), spred.TY(), spred.COV() );
196 
197  //EdbPVRec aview; //with 2 patterns of preselected microtracks
198  //aview.AddPattern( new EdbPattern(0,0,214)); // TODO! sequence??
199  //aview.AddPattern( new EdbPattern(0,0,0) );
200 
201 
202  for(int side=1; side<=2; side++) {
203 
204 
205  if(side==1)
206  {
207  for(int i=0; i<eSide1.N(); i++) {
208  EdbSegP *s = eSide1.GetSegment(i);
209  s->SetErrors();
210  eCondMT.FillErrorsCov( spred.TX(), spred.TY(), s->COV() );
211  }
212  eSide1.FillCell(10,10,0.01,0.01); //divide view on this cells
213  TArrayF chi2arr(10000); //TODO!
214  TObjArray found;
215  FindCompliments( spred, eSide1, found, ePreliminaryChi2MaxMT, chi2arr );
216  for(int j=0; j<found.GetEntriesFast(); j++) {
217  EdbSegP *s = (EdbSegP *)(found.At(j));
218  s->SetChi2(chi2arr[j]);
219  if (side==1) fnds1.AddSegment(*s);
220  else if(side==2) fnds2.AddSegment(*s);
221  }
222  }
223  else
224  {
225  for(int i=0; i<eSide2.N(); i++) {
226  EdbSegP *s = eSide2.GetSegment(i);
227  s->SetErrors();
228  eCondMT.FillErrorsCov( spred.TX(), spred.TY(), s->COV() );
229  }
230  eSide2.FillCell(10,10,0.01,0.01); //divide view on this cells
231  TArrayF chi2arr(10000); //TODO!
232  TObjArray found;
233  FindCompliments( spred, eSide2, found, ePreliminaryChi2MaxMT, chi2arr );
234  for(int j=0; j<found.GetEntriesFast(); j++) {
235  EdbSegP *s = (EdbSegP *)(found.At(j));
236  s->SetChi2(chi2arr[j]);
237  if (side==1) fnds1.AddSegment(*s);
238  else if(side==2) fnds2.AddSegment(*s);
239  }
240  }
241 
242 
243  }//end loop on two emulsion layers
244 
245  // filling fndbt
246 
247  EdbPattern bt;
248 
249  for(int is1=0; is1<fnds1.N(); is1++) {
250  for(int is2=0; is2<fnds2.N(); is2++) {
251 
252  EdbSegP *s1 = fnds1.GetSegment(is1);
253  EdbSegP *s2 = fnds2.GetSegment(is2);
254 
255  float dx1=s1->X()-(spred.X()+spred.TX()*(s1->Z()-spred.Z()));
256  float dy1=s1->Y()-(spred.Y()+spred.TY()*(s1->Z()-spred.Z()));
257  float dx2=s2->X()-(spred.X()+spred.TX()*(s2->Z()-spred.Z()));
258  float dy2=s2->Y()-(spred.Y()+spred.TY()*(s2->Z()-spred.Z()));
259  float r = Sqrt( (dx1-dx2)*(dx1-dx2) + (dy1-dy2)*(dy1-dy2) );
260 
261  if(r<eDeltaR) { // has good BT
262  EdbSegP s3;
263  s3.Copy(spred);
264  s3.SetX( 0.5*(s1->X() + s2->X()) );
265  s3.SetY( 0.5*(s1->Y() + s2->Y()) );
266  s3.SetZ( 0.5*(s1->Z() + s2->Z()) );
267  s3.SetTX( (s2->X() - s1->X()) / (s2->Z() - s1->Z()) );
268  s3.SetTY( (s2->Y() - s1->Y()) / (s2->Z() - s1->Z()) );
269  s3.SetW(s1->W()+s2->W());
270  s3.SetVid(s1->ID(),s2->ID());//ale, antonia
271 
272  s3.SetFlag(is2*10000+is1);
273 
274  EdbSegP s4(spred);
275  float chi = EdbTrackFitter::Chi2Seg(&s4, &s3); // depends on the sequence (best defined should be first)
276  //float chi = EdbTrackFitter::Chi2SegM(spred, s3, s4, eCondBT, eCondBT);
277  if(chi<eChi2MaxBT) {
278  s3.SetChi2(chi);
279  bt.AddSegment(s3);
280  }
281  }
282  }
283  }
284 
285  TArrayF chi2arr(bt.N());
286  for (int i=0;i<bt.N();i++) chi2arr[i]=bt.GetSegment(i)->Chi2();
287  TArrayI ind(bt.N());
288  TMath::Sort(bt.N(),chi2arr.GetArray(),ind.GetArray(),false);
289  for(int i=0; i<bt.N(); i++) {
290  EdbSegP *s = bt.GetSegment(ind[i]);
291  fndbt.AddSegment(*s);
292  }
293 
294  // Log(2,"FindCandidates","Found %d basetrack candidate in %d+%d preselected microtracks",fndbt.N(),fnds1.N(),fnds2.N());
295 
296  return 1; //TODO!
297 }
Definition: EdbPattern.h:280
void FillCell(float stepx, float stepy, float steptx, float stepty)
Definition: EdbPattern.cxx:1416
Float_t eChi2MaxBT
Definition: EdbPlateTracking.h:55
Float_t eDeltaR
Definition: EdbPlateTracking.h:49
Float_t ePreliminaryChi2MaxMT
Definition: EdbPlateTracking.h:44
EdbScanCond eCondBT
Definition: EdbPlateTracking.h:39
EdbScanCond eCondMT
Definition: EdbPlateTracking.h:38
int ExtrapolateCond(EdbScanCond &inputcond, int flag, EdbScanCond &outputcond)
Definition: EdbPlateTracking.cxx:107
int FindCompliments(EdbSegP &s, EdbPattern &pat, TObjArray &found, float chi2max, TArrayF &chiarr)
Definition: EdbPlateTracking.cxx:126
Definition: EdbScanCond.h:10
void Print() const
Definition: EdbScanCond.cxx:50
void FillErrorsCov(float tx, float ty, TMatrixD &cov)
Definition: EdbScanCond.cxx:161
void SetY(Float_t y)
Definition: EdbSegP.h:175
void SetErrors()
Definition: EdbSegP.h:89
TMatrixD & COV() const
Definition: EdbSegP.h:120
void SetTX(Float_t tx)
Definition: EdbSegP.h:176
Int_t ID() const
Definition: EdbSegP.h:144
void SetX(Float_t x)
Definition: EdbSegP.h:174
void SetZ(float z)
Definition: EdbSegP.h:122
void SetTY(Float_t ty)
Definition: EdbSegP.h:177
void SetW(float w)
Definition: EdbSegP.h:129
void SetVid(int vid, int sid)
Definition: EdbSegP.h:134
void SetFlag(int flag)
Definition: EdbSegP.h:127
Int_t Flag() const
Definition: EdbSegP.h:146
static float Chi2Seg(EdbSegP *s1, EdbSegP *s2)
Definition: EdbTrackFitter.cxx:62
gEDBDEBUGLEVEL
Definition: energy.C:7
void r(int rid=2)
Definition: test.C:201

◆ FindCompliments()

int EdbPlateTracking::FindCompliments ( EdbSegP s,
EdbPattern pat,
TObjArray &  found,
float  chi2max,
TArrayF &  chiarr 
)
127 {
128  // return found sorted by increasing chi2
129 
130  int nfound=0;
131  int maxcand=chiarr.GetSize();
132  TArrayF chi2arr(maxcand);
133  TObjArray arr(maxcand);
134  TArrayI ind(maxcand);
135 
136  int nseg = pat.FindCompliments(s,arr,30,200); // acceptance (prelim): s.SX()*30; s.STX*200
137  // printf("\nnseg = %d\n",nseg);
138  if(nseg>maxcand) {
139  printf("Warning!: Too many segments %d, accept only the first %d \n", nseg, maxcand);
140  nseg = maxcand;
141  }
142  if(nseg<=0) return 0;
143 
144  EdbSegP *s2=0;
145  for(int j=0; j<nseg; j++) {
146  s2 = (EdbSegP *)arr.At(j);
147  EdbSegP s3;
148  s3.Copy(s);
149  chi2arr[j] = EdbTrackFitter::Chi2Seg(&s3, s2);
150  //chi2arr[j] = EdbTrackFitter::Chi2SegM(s, *s2,s3,eCondBT,eCondMT);
151  }
152  TMath::Sort(nseg,chi2arr.GetArray(),ind.GetArray(),0);
153  // printf("pred = %f %f %f %f\n",s.X(),s.Y(),s.TX(),s.TY());
154  for(int j=0; j<nseg; j++) {
155  s2 = (EdbSegP *)arr.At(ind[j]);
156  // printf("j = %d, ind = %d, chi2 = %f %f\n",j,ind[j],chi2arr[ind[j]],chi2max);
157  // printf("Tx = %f %f %f %f\n",s2->X(),s2->Y(),s2->TX(),s2->TY());
158  if(chi2arr[ind[j]] > chi2max ) break;
159  chiarr[j] = chi2arr[ind[j]];
160  s2->SetMC(s.MCEvt(),s.MCTrack());
161  found.Add(s2);
162  nfound++;
163  }
164 
165  // printf("nfound = %d\n",nfound);
166  return nfound;
167 }
int FindCompliments(EdbSegP &s, TObjArray &arr, float nsig, float nsigt)
Definition: EdbPattern.cxx:1447
void SetMC(int mEvt, int mTrack)
Definition: EdbSegP.h:138
Int_t MCTrack() const
Definition: EdbSegP.h:143
Int_t MCEvt() const
Definition: EdbSegP.h:142

◆ FindPrediction()

int EdbPlateTracking::FindPrediction ( EdbSegP spred,
EdbSegP fndbt,
EdbSegP fnds1,
EdbSegP fnds2,
EdbSegP snewpred 
)
341 {
342  // Select the best (micro or base) track matching with the prediction
343  // and prepare for a new search.
344  //
345  // Selection criteria:
346  // 1) Call FindCandidates having the list of basetrack and microtrack candidates
347  // 2) Call FindCandidateBT which looks for the best basetrack, if any
348  // 3) If no basetrack is found, call FindCandidateMT which looks fot the best microtrack, if any.
349  // Microtracks accepted shold satisfy the following cut: (puls >= ePulsMinMT) (10) and (chi2 < eChi2MaxMT)
350  //
351  // Input:
352  // spred - track prediction
353  // Output:
354  // - if a basetrack is found (status 0):
355  // fndbt - basetrack found
356  // fnds1 - microtrack top contained in the found basetrack
357  // fnds2 - microtrack bottom contained in the found basetrack
358  // snewpred - fndbt with flag equal to 0
359  //
360  // - if a microtrack top is found (status 1):
361  // fndbt - dummy
362  // fnds1 - microtrack top found
363  // fnds2 - dummy
364  // snewpred - a track with slopes from the prediction spred and positions
365  // from an extrapolation of fnds1. The flag is updated by UpdateFlag
366  //
367  // - if a microtrack bottom is found (status 2):
368  // fndbt - dummy
369  // fnds1 - dummy
370  // fnds2 - microtrack bottom found
371  // snewpred - a track with slopes from the prediction spred and positions
372  // from an extrapolation of fnds2. The flag is updated by UpdateFlag
373  //
374  // - if nothing is found (status -1):
375  // fndbt - dummy
376  // fnds1 - dummy
377  // fnds2 - dummy
378  // snewpred - the prediction spred. The flag is updated by UpdateFlag
379  //
380  // Return:
381  // -1: no track found
382  // 0: basetrack found
383  // 1: microtrack top found
384  // 2: microtrack bottom found
385 
386  //EdbPattern vfndbt,vfnds1,vfnds2;
387 
388  eStatus = -1;
389  SetPred(spred);
390  FindCandidates( spred, eSpre, eS1pre, eS2pre ); //eSpre , eS1pre , eS2pre riempiti
391 
392  EdbSegP fnd;
394  if ( nbt > 0 ) {
395  eS.Copy(fnd);
396  eS1.Copy(*(eS1pre.GetSegment(fnd.Flag()%10000)));
397  eS2.Copy(*(eS2pre.GetSegment(fnd.Flag()/10000)));
398  eS.SetFlag(0);
399  eNext.Copy(fnd);
400  eNext.SetFlag(UpdateFlag(spred.Flag(),0)); // if bt found : bth=0, mth=0, tb=0
401  eStatus = 0;
402  }
403 
404  int if_mt = FindCandidateMT(eS1pre,eS2pre,fnd);
405  if(eStatus!=-1) goto RESUME;
406 
407  switch(if_mt) {
408  case 0: // find nothing
409  eNext.Copy(spred);
410  eNext.SetFlag(UpdateFlag(spred.Flag(),-1)); // hole: if not found: bth++, mth++, tb= keep last value
411  eNext.SetW(0);
412  eStatus = -1; goto RESUME;
413  case 1: // best microtrack is on the 1-st side
414  eS1.Copy(fnd);
415  eNext.Copy(spred);
416  eNext.SetX( fnd.X() + spred.TX()*(spred.Z()-fnd.Z()) );
417  eNext.SetY( fnd.Y() + spred.TY()*(spred.Z()-fnd.Z()) );
418  eNext.SetZ(spred.Z());
419  eNext.SetFlag(UpdateFlag(spred.Flag(),1)); // if mt found : bth++, mth=0, tb=1
420  eNext.SetW(fnd.W());
421  eNext.SetID(fnd.ID());//ale,antonia
422  eStatus = 1; goto RESUME;
423  case 2: // best microtrack is on the 2-d side
424  eS2.Copy(fnd);
425  eNext.Copy(spred);
426  eNext.SetX( fnd.X() + spred.TX()*(spred.Z()-fnd.Z()) );
427  eNext.SetY( fnd.Y() + spred.TY()*(spred.Z()-fnd.Z()) );
428  eNext.SetZ(spred.Z());
429  eNext.SetFlag(UpdateFlag(spred.Flag(),2)); // if mt found : bth++, mth=0, tb=2
430  eNext.SetW(fnd.W());
431  eNext.SetID(fnd.ID());//ale,antonia
432  eStatus = 2; goto RESUME;
433  }
434 
435  RESUME:
436 
437  /* Log(2,"FindPrediction","status = %d, good candidates [s:s1:s2] %d:%d:%d ; preliminary [s:s1:s2] %d:%d:%d",
438  eStatus,
439  eScnd.N(),eS1cnd.N(),eS2cnd.N(),
440  eSpre.N(),eS1pre.N(),eS2pre.N()
441  );*/
442  snewpred.Copy(eNext);
443  fndbt.Copy(eS);
444  fnds1.Copy(eS1);
445  fnds2.Copy(eS2);
446  return eStatus;
447 }
EdbPattern eSpre
Definition: EdbPlateTracking.h:51
Float_t ePulsMinDegradBT
Definition: EdbPlateTracking.h:60
int FindCandidateMT(EdbPattern &fnds1, EdbPattern &fnds2, EdbSegP &fnd)
Definition: EdbPlateTracking.cxx:300
Int_t eStatus
Definition: EdbPlateTracking.h:34
EdbSegP eNext
Definition: EdbPlateTracking.h:33
EdbSegP eS2
Definition: EdbPlateTracking.h:32
EdbSegP eS1
Definition: EdbPlateTracking.h:32
int UpdateFlag(int flag, int status)
Definition: EdbPlateTracking.cxx:88
EdbPattern eS2pre
Definition: EdbPlateTracking.h:47
EdbSegP eS
Definition: EdbPlateTracking.h:32
void SetPred(const EdbSegP &pred)
Definition: EdbPlateTracking.cxx:52
EdbPattern eS1pre
Definition: EdbPlateTracking.h:46
Float_t ePulsMinBT
Definition: EdbPlateTracking.h:53
int FindCandidates(EdbSegP &spred, EdbPattern &fndbt, EdbPattern &fnds1, EdbPattern &fnds2)
Definition: EdbPlateTracking.cxx:171
EdbPattern eScnd
Definition: EdbPlateTracking.h:57
void SetID(int id)
Definition: EdbSegP.h:125

◆ FindPredictionDS()

int EdbPlateTracking::FindPredictionDS ( EdbSegP spred,
EdbSegP fndbt,
EdbSegP fnds1,
EdbSegP fnds2,
EdbSegP snewpred,
float  maxdmin = 1. 
)
517 {
518  // Select the best (micro or base) track matching with the prediction
519  // and prepare for a new search.
520  //
521  // Selection criteria:
522  // 1) Call FindCandidates having the list of basetrack and microtrack candidates
523  // 2) Call FindCandidateBT which looks for the best basetrack, if any
524  // 3) If no basetrack is found, call FindCandidateMT which looks fot the best microtrack, if any.
525  // Microtracks accepted shold satisfy the following cut: (puls >= ePulsMinMT) (10) and (chi2 < eChi2MaxMT)
526  //
527  // Input:
528  // spred - track prediction
529  // Output:
530  // - if a basetrack is found (status 0):
531  // fndbt - basetrack found
532  // fnds1 - microtrack top contained in the found basetrack
533  // fnds2 - microtrack bottom contained in the found basetrack
534  // snewpred - fndbt with flag equal to 0
535  //
536  // - if a microtrack top is found (status 1):
537  // fndbt - dummy
538  // fnds1 - microtrack top found
539  // fnds2 - dummy
540  // snewpred - a track with slopes from the prediction spred and positions
541  // from an extrapolation of fnds1. The flag is updated by UpdateFlag
542  //
543  // - if a microtrack bottom is found (status 2):
544  // fndbt - dummy
545  // fnds1 - dummy
546  // fnds2 - microtrack bottom found
547  // snewpred - a track with slopes from the prediction spred and positions
548  // from an extrapolation of fnds2. The flag is updated by UpdateFlag
549  //
550  // - if nothing is found (status -1):
551  // fndbt - dummy
552  // fnds1 - dummy
553  // fnds2 - dummy
554  // snewpred - the prediction spred. The flag is updated by UpdateFlag
555  //
556  // Return:
557  // -1: no track found
558  // 0: basetrack found
559  // 1: microtrack top found
560  // 2: microtrack bottom found
561 
562  //EdbPattern vfndbt,vfnds1,vfnds2;
563 
564  eStatus = -1;
565  SetPred(spred);
566  FindCandidates( spred, eSpre, eS1pre, eS2pre ); //eSpre , eS1pre , eS2pre riempiti
567 
568 
569  EdbSegP fnd;
570  int nbt = FindBestCandidateDS(eSpre,fnd, eScnd, ePulsMinBT, ePulsMinDegradBT, eChi2MaxBT, spred, maxdmin);
571  if ( nbt > 0 ) {
572  eS.Copy(fnd);
573  eS1.Copy(*(eS1pre.GetSegment(fnd.Flag()%10000)));
574  eS2.Copy(*(eS2pre.GetSegment(fnd.Flag()/10000)));
575  eS.SetFlag(0);
576  eNext.Copy(fnd);
577  eNext.SetFlag(UpdateFlag(spred.Flag(),0)); // if bt found : bth=0, mth=0, tb=0
578  eStatus = 0;
579  }
580 
581  int if_mt = FindCandidateMTDS(eS1pre,eS2pre,fnd,spred,maxdmin);
582  if(eStatus!=-1) goto RESUME;
583 
584  switch(if_mt) {
585  case 0: // find nothing
586  eNext.Copy(spred);
587  eNext.SetFlag(UpdateFlag(spred.Flag(),-1)); // hole: if not found: bth++, mth++, tb= keep last value
588  eNext.SetW(0);
589  eStatus = -1; goto RESUME;
590  case 1: // best microtrack is on the 1-st side
591  eS1.Copy(fnd);
592  eNext.Copy(spred);
593  eNext.SetX( fnd.X() + spred.TX()*(spred.Z()-fnd.Z()) );
594  eNext.SetY( fnd.Y() + spred.TY()*(spred.Z()-fnd.Z()) );
595  eNext.SetZ(spred.Z());
596  eNext.SetFlag(UpdateFlag(spred.Flag(),1)); // if mt found : bth++, mth=0, tb=1
597  eNext.SetW(fnd.W());
598  eNext.SetID(fnd.ID());//ale,antonia
599  eStatus = 1; goto RESUME;
600  case 2: // best microtrack is on the 2-d side
601  eS2.Copy(fnd);
602  eNext.Copy(spred);
603  eNext.SetX( fnd.X() + spred.TX()*(spred.Z()-fnd.Z()) );
604  eNext.SetY( fnd.Y() + spred.TY()*(spred.Z()-fnd.Z()) );
605  eNext.SetZ(spred.Z());
606  eNext.SetFlag(UpdateFlag(spred.Flag(),2)); // if mt found : bth++, mth=0, tb=2
607  eNext.SetW(fnd.W());
608  eNext.SetID(fnd.ID());//ale,antonia
609  eStatus = 2; goto RESUME;
610  }
611 
612  RESUME:
613 
614  /* Log(2,"FindPredictionDS","status = %d, good candidates [s:s1:s2] %d:%d:%d ; preliminary [s:s1:s2] %d:%d:%d",
615  eStatus,
616  eScnd.N(),eS1cnd.N(),eS2cnd.N(),
617  eSpre.N(),eS1pre.N(),eS2pre.N()
618  );*/
619  snewpred.Copy(eNext);
620  fndbt.Copy(eS);
621  fnds1.Copy(eS1);
622  fnds2.Copy(eS2);
623  return eStatus;
624 }
int FindCandidateMTDS(EdbPattern &fnds1, EdbPattern &fnds2, EdbSegP &fnd, EdbSegP &spred, float maxdmin)
Definition: EdbPlateTracking.cxx:450

◆ FindTrack()

int EdbPlateTracking::FindTrack ( EdbTrackP pred,
EdbTrackP found,
EdbPlateP plate 
)
770 {
771  // look for tracks in this plate
772  // track - input track in brick RS - will be updated on output
773  // plate - all plate parameters including affine transformation plate-to-brick
774 
775  int status=-100;
776  float DZmax = 1350*100;
777 
778  EdbAffine2D p2b(*(plate.GetAffineXY())); // from plate to brick
779  EdbAffine2D b2p(p2b); b2p.Invert(); // from brick to plate
780 
781  EdbSegP ps;
782  float dz = pred.MakePredictionTo(plate.Z(), ps);
783 
784  if(Abs(dz)>DZmax) return status;
785  if(GetBTHoles(pred.Flag())>5) return status;
786  if(GetMTHoles(pred.Flag())>3) return status;
787 
788  ps.SetFlag(pred.Flag());
789  ps.Transform(&b2p); // plate.Transoform(seg) ???
790 
791  EdbSegP fndbt, fnds1, fnds2, snewpred;
792  status = FindPrediction( ps, fndbt, fnds1, fnds2, snewpred ); // -1: not found; 0-bt, 1-bot, 2-top
793  found.SetFlag(snewpred.Flag());
794 
795  TransformFromPlateRS(); // transform all components into brick RS
796 
797  if(status>=0) {
798  found.AddSegment( new EdbSegP(eNext) );
799  found.AddSegmentF( new EdbSegP(ePred) ); // add prediction as "fitted segment" because it is an extrapolation
800  found.SetSegmentsTrack();
801  }
802 
803  // Log(2,"EdbPlateTracking::FindTracks","status = %d",status);
804  return status;
805 }
brick dz
Definition: RecDispMC.C:107
Definition: EdbAffine.h:17
int FindPrediction(EdbSegP &spred, EdbSegP &fndbt, EdbSegP &fnds1, EdbSegP &fnds2, EdbSegP &snewpred)
Definition: EdbPlateTracking.cxx:340
void TransformFromPlateRS()
Definition: EdbPlateTracking.cxx:808
virtual void Transform(const EdbAffine2D *a)
void AddSegmentF(EdbSegP *s)
Definition: EdbPattern.h:238
void AddSegment(EdbSegP *s)
Definition: EdbPattern.h:219
float MakePredictionTo(Float_t z, EdbSegP &ss)
Definition: EdbPattern.cxx:1143
int SetSegmentsTrack(int id)
Definition: EdbPattern.h:252
float DZmax
Definition: check_vertex.C:28

◆ GetBTHoles()

static int EdbPlateTracking::GetBTHoles ( int  flag)
inlinestatic
121 { return(flag/10000); }

◆ GetMTHoles()

static int EdbPlateTracking::GetMTHoles ( int  flag)
inlinestatic
122 { return((flag/100)%100); }

◆ GetSBtreeEntry()

bool EdbPlateTracking::GetSBtreeEntry ( int  entry,
TTree &  tsbt 
)
711 {
712  EdbSegP *s_pred = &ePred, *s_bt = &eS, *s_mt1=&eS1, *s_mt2=&eS2, *s_next=&eNext;
713 
714  tsbt.SetBranchAddress("idpred",eIdp);
715  tsbt.SetBranchAddress("idfound",eIdf);
716  tsbt.SetBranchAddress("stat",&eStatus);
717  tsbt.SetBranchAddress("pred.", &s_pred);
718  tsbt.SetBranchAddress("s.", &s_bt);
719  tsbt.SetBranchAddress("s1.", &s_mt1);
720  tsbt.SetBranchAddress("s2.", &s_mt2);
721  tsbt.SetBranchAddress("next.", &s_next);
722 
723  TClonesArray *s_cnd = eScnd.GetSegments();
724  tsbt.SetBranchAddress("scnd", &s_cnd);
725  TClonesArray *s1_cnd = eS1cnd.GetSegments();
726  tsbt.SetBranchAddress("s1cnd", &s1_cnd);
727  TClonesArray *s2_cnd = eS2cnd.GetSegments();
728  tsbt.SetBranchAddress("s2cnd", &s2_cnd);
729 
730  TClonesArray *s_pre = eSpre.GetSegments();
731  tsbt.SetBranchAddress("spre", &s_pre);
732  TClonesArray *s1_pre = eS1pre.GetSegments();
733  tsbt.SetBranchAddress("s1pre", &s1_pre);
734  TClonesArray *s2_pre = eS2pre.GetSegments();
735  tsbt.SetBranchAddress("s2pre", &s2_pre);
736 
737  tsbt.GetEntry(entry);
738  return true;
739 }
TLegendEntry * entry
Definition: Canv_SYSTEMATICS_ALLCOMBINED__RMSEnergy__vs__Energy__ELECTRON.C:130
Int_t eIdp[4]
Definition: EdbPlateTracking.h:69
Int_t eIdf[4]
Definition: EdbPlateTracking.h:70
TClonesArray * GetSegments() const
Definition: EdbPattern.h:69

◆ InitSBtree()

TTree * EdbPlateTracking::InitSBtree ( const char *  file_name = "sbt.root",
const char *  mode = "RECREATE" 
)
static
630 {
631  const char *tree_name="sbt";
632  TTree *tree=0;
633  if (!tree) {
634  TFile *f = new TFile(file_name,mode);
635  if (f) tree = (TTree*)f->Get(tree_name);
636  if(!tree) {
637 
638  f->cd();
639  tree = new TTree(tree_name,tree_name);
640  tree->SetMaxTreeSize(15000000000LL); //set 15 Gb file size limit)
641 
642  Int_t idp[4], idf[4], stat;
643  EdbSegP *s_pred = 0, *s_bt = 0, *s_mt1=0, *s_mt2=0, *s_next=0;
644  TClonesArray *scnd = new TClonesArray("EdbSegP");
645  TClonesArray *s1cnd = new TClonesArray("EdbSegP");
646  TClonesArray *s2cnd = new TClonesArray("EdbSegP");
647  TClonesArray *spre = new TClonesArray("EdbSegP");
648  TClonesArray *s1pre = new TClonesArray("EdbSegP");
649  TClonesArray *s2pre = new TClonesArray("EdbSegP");
650 
651  tree->Branch("idpred",idp,"idp[4]/I");
652  tree->Branch("idfound",idf,"idf[4]/I");
653  tree->Branch("stat",&stat,"stat/I");
654  tree->Branch("pred.", "EdbSegP", &s_pred);
655  tree->Branch("s.", "EdbSegP", &s_bt);
656  tree->Branch("s1.", "EdbSegP", &s_mt1);
657  tree->Branch("s2.", "EdbSegP", &s_mt2);
658  tree->Branch("next.", "EdbSegP", &s_next);
659  tree->Branch("scnd",&scnd);
660  tree->Branch("s1cnd",&s1cnd);
661  tree->Branch("s2cnd",&s2cnd);
662  tree->Branch("spre",&spre);
663  tree->Branch("s1pre",&s1pre);
664  tree->Branch("s2pre",&s2pre);
665  tree->Write();
666  }
667  }
668 
669  if(!tree) Log(1,"InitSBtree","ERROR!!! can't initialize tree at %s as %s\n",file_name,mode);
670  return tree;
671 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75

◆ Print()

void EdbPlateTracking::Print ( )
67 {
68  printf("EdbPlateTracking selection criteria:\n");
69  printf("Preliminary mt selection:\n");
70  //printf(" eDeltaRview = %5.3f\n", eDeltaRview);
71  //printf(" eDeltaTheta = %5.3f\n", eDeltaTheta);
72  //printf(" ePreliminaryPulsMinMT = %3.1f\n", ePreliminaryPulsMinMT);
73  printf(" ePreliminaryChi2MaxMT = %5.3f\n", ePreliminaryChi2MaxMT);
74  printf("Preliminary bt selection:\n");
75  printf(" eDeltaR = %3.1f\n", eDeltaR);
76  printf(" eChi2MaxBT = %5.3f\n", eChi2MaxBT);
77  printf("Final bt selection:\n");
78  printf(" ePulsMinBT = %3.1f\n", ePulsMinBT);
79  printf(" ePulsMinDegradBT = %3.1f\n", ePulsMinDegradBT);
80  printf("Final mt selection:\n");
81  printf(" ePulsMinMT = %3.1f\n", ePulsMinMT);
82  printf(" ePulsMinDegradMT = %3.1f\n", ePulsMinDegradMT);
83  printf(" eChi2MaxMT = %5.3f\n", eChi2MaxMT);
84  printf("\n");
85 }

◆ Set0()

void EdbPlateTracking::Set0 ( )
28 {
31 
32  // eDeltaRview = 400;
33  // eDeltaTheta = 0.15;
34  // ePreliminaryPulsMinMT = 5;
36 
37  eDeltaR = 20;
38  ePulsMinBT = 18;
39  ePulsMinDegradBT = 0;
40  eChi2MaxBT = 2.5;
41 
42  eChi2MaxMT = 1.6;
43  ePulsMinDegradMT = 0;
44  ePulsMinMT = 10.;
45 
46  eDegradPos = 0;
47  eDegradSlope = 0;
48  ePredictionScan = false;
49 }
bool ePredictionScan
Definition: EdbPlateTracking.h:72
void SetDefault()
Definition: EdbScanCond.cxx:16

◆ SetCondBT()

void EdbPlateTracking::SetCondBT ( EdbScanCond cond)
inline
116 { eCondBT = cond; }

◆ SetCondMT()

void EdbPlateTracking::SetCondMT ( EdbScanCond cond)
inline
115 { eCondMT = cond; }

◆ SetPred()

void EdbPlateTracking::SetPred ( const EdbSegP pred)
53 {
54  ePred.Copy(pred);
55  eNext.Set0();
56  eS.Set0(); eS1.Set0(); eS2.Set0();
57  eS1cnd.Reset();
58  eS2cnd.Reset();
59  eScnd.Reset();
60  eS1pre.Reset();
61  eS2pre.Reset();
62  eSpre.Reset();
63 }
void Reset()
Definition: EdbPattern.cxx:1632

◆ TransformFromPlateRS()

void EdbPlateTracking::TransformFromPlateRS ( )
809 {
810  EdbAffine2D p2b(*(ePlate.GetAffineXY())); // from plate to brick
811 
812  ePred.Transform(&p2b);
813  eNext.Transform(&p2b);
814  eS.Transform(&p2b);
815  eS1.Transform(&p2b);
816  eS2.Transform(&p2b);
817  eScnd.Transform(&p2b);
818  eS1cnd.Transform(&p2b);
819  eS2cnd.Transform(&p2b);
820  eSpre.Transform(&p2b);
821  eS1pre.Transform(&p2b);
822  eS2pre.Transform(&p2b);
823 
824  ePred.SetPID( ePlate.ID() );
825  eNext.SetPID( ePlate.ID() );
826  eS.SetPID( ePlate.ID() );
827  eS1.SetPID( ePlate.ID() );
828  eS2.SetPID( ePlate.ID() );
829  for(int i=0; i<eScnd.N(); i++) eScnd.GetSegment(i)->SetPID( ePlate.ID() );
830  for(int i=0; i<eS1cnd.N(); i++) eS1cnd.GetSegment(i)->SetPID( ePlate.ID() );
831  for(int i=0; i<eS2cnd.N(); i++) eS2cnd.GetSegment(i)->SetPID( ePlate.ID() );
832  for(int i=0; i<eSpre.N(); i++) eSpre.GetSegment(i)->SetPID( ePlate.ID() );
833  for(int i=0; i<eS1pre.N(); i++) eS1pre.GetSegment(i)->SetPID( ePlate.ID() );
834  for(int i=0; i<eS2pre.N(); i++) eS2pre.GetSegment(i)->SetPID( ePlate.ID() );
835 
836  ePred.SetZ( ePlate.Z() );
837  eNext.SetZ( ePlate.Z() );
838  eS.SetZ( ePlate.Z() );
839  eS1.SetZ( ePlate.GetLayer(1)->Z() + ePlate.Z() );
840  eS2.SetZ( ePlate.GetLayer(2)->Z() + ePlate.Z() );
841  for(int i=0; i<eScnd.N(); i++) eScnd.GetSegment(i)->SetZ( ePlate.Z() );
842  for(int i=0; i<eS1cnd.N(); i++) eS1cnd.GetSegment(i)->SetZ( ePlate.GetLayer(1)->Z() + ePlate.Z() );
843  for(int i=0; i<eS2cnd.N(); i++) eS2cnd.GetSegment(i)->SetZ( ePlate.GetLayer(2)->Z() + ePlate.Z() );
844  for(int i=0; i<eSpre.N(); i++) eSpre.GetSegment(i)->SetZ( ePlate.Z() );
845  for(int i=0; i<eS1pre.N(); i++) eS1pre.GetSegment(i)->SetZ( ePlate.GetLayer(1)->Z() + ePlate.Z() );
846  for(int i=0; i<eS2pre.N(); i++) eS2pre.GetSegment(i)->SetZ( ePlate.GetLayer(2)->Z() + ePlate.Z() );
847 
848  eNext.SetDZ( ePlate.GetLayer(0)->DZ() );
849  eS.SetDZ( ePlate.GetLayer(0)->DZ() );
850  eS1.SetDZ( ePlate.GetLayer(1)->DZ());
851  eS2.SetDZ( ePlate.GetLayer(2)->DZ());
852  for(int i=0; i<eScnd.N(); i++) eScnd.GetSegment(i)->SetDZ( ePlate.GetLayer(0)->DZ() );
853  for(int i=0; i<eS1cnd.N(); i++) eS1cnd.GetSegment(i)->SetDZ( ePlate.GetLayer(1)->DZ() );
854  for(int i=0; i<eS2cnd.N(); i++) eS2cnd.GetSegment(i)->SetDZ( ePlate.GetLayer(2)->DZ() );
855  for(int i=0; i<eSpre.N(); i++) eSpre.GetSegment(i)->SetDZ( ePlate.GetLayer(0)->DZ() );
856  for(int i=0; i<eS1pre.N(); i++) eS1pre.GetSegment(i)->SetDZ( ePlate.GetLayer(1)->DZ() );
857  for(int i=0; i<eS2pre.N(); i++) eS2pre.GetSegment(i)->SetDZ( ePlate.GetLayer(2)->DZ() );
858 }
int ID() const
Definition: EdbLayer.h:74
EdbAffine2D * GetAffineXY()
Definition: EdbLayer.h:120
float DZ() const
Definition: EdbLayer.h:85
float Z() const
Definition: EdbLayer.h:78
EdbLayer * GetLayer(int i)
Definition: EdbBrick.h:28
virtual void Transform(const EdbAffine2D *a)
Definition: EdbVirtual.cxx:154
void SetPID(int pid)
Definition: EdbSegP.h:126
void SetDZ(float dz)
Definition: EdbSegP.h:123

◆ UpdateFlag()

int EdbPlateTracking::UpdateFlag ( int  flag,
int  status 
)
89 {
90  // status: -1 -found nothing, 0-bt, 1-mt1, 2-mt2
91 
92  int bth = flag/10000;
93  int mth = (flag/100)%100;
94  int tb = flag%10;
95 
96  switch (status) {
97  case -1: bth++; mth++; break;
98  case 0: bth=0; mth=0; tb=0; break;
99  case 1: bth++; mth=0; tb=1; break;
100  case 2: bth++; mth=0; tb=2; break;
101  }
102 
103  return( bth*10000+mth*100+tb );
104 }

◆ UpdateSBtree()

bool EdbPlateTracking::UpdateSBtree ( TTree &  tsbt,
int  idp[4],
int  idf[4] 
)
678 {
679  EdbSegP *s_pred = &ePred, *s_bt = &eS, *s_mt1=&eS1, *s_mt2=&eS2, *s_next=&eNext;
680 
681  tsbt.SetBranchAddress("idpred",idp);
682  tsbt.SetBranchAddress("idfound",idf);
683  tsbt.SetBranchAddress("stat",&eStatus);
684  tsbt.SetBranchAddress("pred.", &s_pred);
685  tsbt.SetBranchAddress("s.", &s_bt);
686  tsbt.SetBranchAddress("s1.", &s_mt1);
687  tsbt.SetBranchAddress("s2.", &s_mt2);
688  tsbt.SetBranchAddress("next.", &s_next);
689 
690  TClonesArray *s_cnd = eScnd.GetSegments();
691  tsbt.SetBranchAddress("scnd", &s_cnd);
692  TClonesArray *s1_cnd = eS1cnd.GetSegments();
693  tsbt.SetBranchAddress("s1cnd", &s1_cnd);
694  TClonesArray *s2_cnd = eS2cnd.GetSegments();
695  tsbt.SetBranchAddress("s2cnd", &s2_cnd);
696 
697  TClonesArray *s_pre = eSpre.GetSegments();
698  tsbt.SetBranchAddress("spre", &s_pre);
699  TClonesArray *s1_pre = eS1pre.GetSegments();
700  tsbt.SetBranchAddress("s1pre", &s1_pre);
701  TClonesArray *s2_pre = eS2pre.GetSegments();
702  tsbt.SetBranchAddress("s2pre", &s2_pre);
703 
704  tsbt.Fill();
705  return true;
706 }

Member Data Documentation

◆ eChi2MaxBT

Float_t EdbPlateTracking::eChi2MaxBT

◆ eChi2MaxMT

Float_t EdbPlateTracking::eChi2MaxMT

◆ eCondBT

EdbScanCond EdbPlateTracking::eCondBT

◆ eCondMT

EdbScanCond EdbPlateTracking::eCondMT

◆ eDegradPos

Float_t EdbPlateTracking::eDegradPos

◆ eDegradSlope

Float_t EdbPlateTracking::eDegradSlope

◆ eDeltaR

Float_t EdbPlateTracking::eDeltaR

◆ eIdf

Int_t EdbPlateTracking::eIdf[4]

◆ eIdp

Int_t EdbPlateTracking::eIdp[4]

◆ eNext

EdbSegP EdbPlateTracking::eNext

◆ ePlate

EdbPlateP EdbPlateTracking::ePlate

◆ ePred

EdbSegP EdbPlateTracking::ePred

◆ ePredictionScan

bool EdbPlateTracking::ePredictionScan

◆ ePreliminaryChi2MaxMT

Float_t EdbPlateTracking::ePreliminaryChi2MaxMT

◆ ePulsMinBT

Float_t EdbPlateTracking::ePulsMinBT

◆ ePulsMinDegradBT

Float_t EdbPlateTracking::ePulsMinDegradBT

◆ ePulsMinDegradMT

Float_t EdbPlateTracking::ePulsMinDegradMT

◆ ePulsMinMT

Float_t EdbPlateTracking::ePulsMinMT

◆ eS

EdbSegP EdbPlateTracking::eS

◆ eS1

EdbSegP EdbPlateTracking::eS1

◆ eS1cnd

EdbPattern EdbPlateTracking::eS1cnd

◆ eS1pre

EdbPattern EdbPlateTracking::eS1pre

◆ eS2

EdbSegP EdbPlateTracking::eS2

◆ eS2cnd

EdbPattern EdbPlateTracking::eS2cnd

◆ eS2pre

EdbPattern EdbPlateTracking::eS2pre

◆ eScnd

EdbPattern EdbPlateTracking::eScnd

◆ eSide1

EdbPattern EdbPlateTracking::eSide1

◆ eSide2

EdbPattern EdbPlateTracking::eSide2

◆ eSpre

EdbPattern EdbPlateTracking::eSpre

◆ eStatus

Int_t EdbPlateTracking::eStatus

The documentation for this class was generated from the following files: