FEDRA emulsion software from the OPERA Collaboration
EdbPatCell2.h
Go to the documentation of this file.
1 #ifndef ROOT_EdbPatCell2
2 #define ROOT_EdbPatCell2
3 
4 #include "EdbLayer.h"
5 #include "EdbPattern.h"
6 #include "EdbCell2.h"
7 
8 //-------------------------------------------------------------------------------------------------
9 class EdbPatCell2 : public EdbCell2
10 {
11 public:
12  float eDXlim, eDYlim; // acceptance limits for the combinations selection
13  float eDTXlim, eDTYlim; //
14 
15  float eXmarg, eYmarg; // margins for the cell definition
16 
17  bool eApplyCorr;
18  float eDX, eDY, eDZ; // corrections to be applied if eApplyCorr==true
19  float eShr; // corrections to be applied if eApplyCorr==true
20  float eDTX, eDTY; // corrections to be applied if eApplyCorr==true
21  float ePhi; // rotation angle (using dx,dy one can set-up the center of rotation)
22 
23  TH1I *eDoubletsRate; // to be filled in FillCombinations()
24 
25 public:
26  EdbPatCell2();
27  virtual ~EdbPatCell2(){ResetCorr();}
28 
29  void ResetCorr();
30  void PrintCorr();
31  void InitPat(EdbPattern &pat, int nx, int ny); // define limits to fit the pattern
32  void InitPatBin(EdbPattern &pat, float binx, float biny); // define limits to fit the pattern
33 
34  int FillCell(EdbPattern &pat); // limits should be already defined
35  int FillCell(TObjArray &pat); // limits should be already defined
36 
37  int FillCombinations(EdbPatCell2 &cell, int ir2[2], TObjArray &arrC1, TObjArray &arrC2, bool doFill=1);
38 
39 
40  float Xs(EdbSegP &s) { if(!eApplyCorr) return s.eX; if(ePhi<0.00001) return XsPos(s); else return XsRot(s); }
41  float Ys(EdbSegP &s) { if(!eApplyCorr) return s.eY; if(ePhi<0.00001) return YsPos(s); else return YsRot(s); }
42 
43  float XsPos(EdbSegP &s) { return eApplyCorr? eDX + s.eX + TXs(s)*eDZ : s.eX; }
44  float YsPos(EdbSegP &s) { return eApplyCorr? eDY + s.eY + TYs(s)*eDZ : s.eY; }
45 
46  float XsRot(EdbSegP &s) { return XsPos(s)*TMath::Cos(ePhi)-YsPos(s)*TMath::Sin(ePhi); }
47  float YsRot(EdbSegP &s) { return XsPos(s)*TMath::Sin(ePhi)+YsPos(s)*TMath::Cos(ePhi); }
48 
49  float TXs(EdbSegP &s) { return eApplyCorr? s.eTX/eShr+eDTX : s.eTX; }
50  float TYs(EdbSegP &s) { return eApplyCorr? s.eTY/eShr+eDTY : s.eTY; }
51 
52  void ApplyCorrections(EdbPattern &pat);
53 
54  void ApplyCorrections(EdbLayer &layer);
55  void AcceptCorrections(EdbLayer &layer);
56 
58 
59  ClassDef(EdbPatCell2,1) // helper class to analyse the single pattern
60 };
61 
62 #endif /* ROOT_EdbPatCell2 */
Definition: EdbCell2.h:151
Definition: EdbCell2.h:19
Definition: EdbLayer.h:40
Definition: EdbPatCell2.h:10
float eShr
Definition: EdbPatCell2.h:19
float XsPos(EdbSegP &s)
Definition: EdbPatCell2.h:43
int FillCombinations(EdbPatCell2 &cell, int ir2[2], TObjArray &arrC1, TObjArray &arrC2, bool doFill=1)
Definition: EdbPatCell2.cxx:122
float eDZ
Definition: EdbPatCell2.h:18
float eDYlim
Definition: EdbPatCell2.h:12
int FillCell(EdbPattern &pat)
Definition: EdbPatCell2.cxx:96
float eDXlim
Definition: EdbPatCell2.h:12
float TYs(EdbSegP &s)
Definition: EdbPatCell2.h:50
TH1I * eDoubletsRate
Definition: EdbPatCell2.h:23
float eDX
Definition: EdbPatCell2.h:18
float YsRot(EdbSegP &s)
Definition: EdbPatCell2.h:47
void ResetCorr()
Definition: EdbPatCell2.cxx:28
void PrintCorr()
Definition: EdbPatCell2.cxx:21
float XsRot(EdbSegP &s)
Definition: EdbPatCell2.h:46
EdbH2 * FillSelectedH2()
Definition: EdbPatCell2.cxx:171
float Xs(EdbSegP &s)
Definition: EdbPatCell2.h:40
float eXmarg
Definition: EdbPatCell2.h:15
EdbPatCell2()
Definition: EdbPatCell2.cxx:12
float eDTX
Definition: EdbPatCell2.h:20
float eDY
Definition: EdbPatCell2.h:18
void InitPat(EdbPattern &pat, int nx, int ny)
Definition: EdbPatCell2.cxx:72
float TXs(EdbSegP &s)
Definition: EdbPatCell2.h:49
float eDTYlim
Definition: EdbPatCell2.h:13
float YsPos(EdbSegP &s)
Definition: EdbPatCell2.h:44
float eDTY
Definition: EdbPatCell2.h:20
float ePhi
Definition: EdbPatCell2.h:21
virtual ~EdbPatCell2()
Definition: EdbPatCell2.h:27
float eDTXlim
Definition: EdbPatCell2.h:13
float eYmarg
Definition: EdbPatCell2.h:15
void InitPatBin(EdbPattern &pat, float binx, float biny)
Definition: EdbPatCell2.cxx:84
bool eApplyCorr
Definition: EdbPatCell2.h:17
float Ys(EdbSegP &s)
Definition: EdbPatCell2.h:41
void ApplyCorrections(EdbPattern &pat)
Definition: EdbPatCell2.cxx:61
void AcceptCorrections(EdbLayer &layer)
Definition: EdbPatCell2.cxx:37
Definition: EdbPattern.h:280
Definition: EdbSegP.h:18
Float_t eX
Definition: EdbSegP.h:28
Float_t eTX
Definition: EdbSegP.h:29
Float_t eTY
Definition: EdbSegP.h:29
Float_t eY
Definition: EdbSegP.h:28
int nx
Definition: emthickness.cpp:60
int ny
Definition: emthickness.cpp:62
EdbSegP * s
Definition: tlg2pattern.C:32