1 #ifndef ALIITSMULTRECBG_H
2 #define ALIITSMULTRECBG_H
4 ///////////////////////////////////////////////////////////////////////////////
6 // Class for generating combinatorial backgroung //
7 // for the SPD tracklets //
9 ///////////////////////////////////////////////////////////////////////////////
14 #include "../ITS/AliITSMultReconstructor.h"
15 #include "../ITS/AliITSRecPoint.h"
18 class AliITSMultRecBg : public AliITSMultReconstructor
21 enum {kData, // normal reconstruction
22 kBgRot, // bg with rotation
23 kBgInj, // bg with injection
24 kBgMix // bg with mixing
28 virtual ~AliITSMultRecBg();
30 void Run(TTree* tree, Float_t* vtx, TTree* treeMix=0);
32 void SetRecType(UInt_t m=kData) {fRecType = m;}
33 Int_t GetRecType() const {return fRecType;}
35 void SetInjScale(Float_t s=1.) {fInjScale = s>0? s:1.;}
36 Int_t GetNInjTrials(Int_t lr=-1) const {return lr<0 ? fInjNTrials[0]+fInjNTrials[1] : fInjNTrials[lr];}
37 Int_t GetNInjSuccsess(Int_t lr=-1) const {return lr<0 ? fInjNSuccess[0]+fInjNSuccess[1] : fInjNSuccess[lr];}
39 void Print(Option_t *opt=0) const {AliITSMultReconstructor::Print(opt);}
42 virtual void CreateMultiplicityObject();
44 AliITSMultRecBg(const AliITSMultRecBg &src);
46 void GenInjBgSample(TTree* treeRP, Float_t *vtx);
47 Bool_t PrepareInjBgGenerator(Float_t *vtx);
49 Bool_t GenClusterToInject();
50 void PlaceInjCluster();
51 Int_t PickClusterPrototype(Int_t lr, Int_t ladInStave, Int_t stave2avoid);
52 UInt_t* GenClusterPattern(Int_t &npix, Int_t &ny, Int_t &nz, Float_t cy,Float_t &cz);
53 Int_t SearchInjTracklet(const Float_t *vtx);
54 Int_t GetPixelBitC(int stave, int chip, int col, int row) const {return row+((col+((chip+stave*20)<<5))<<8);} // row + (col+ (chip + stave*20)*32)*256;
55 Int_t GetPixelBitL(int stave, int ladder,int col, int row) const {return row+((col+(ladder+(stave<<2))*32*5)<<8);} // row + (col + (ladder + stave*4)*32*5)*256
56 void ExtractPixelL(int id, int &stave, int &ladder, int &col, int &row) const;
60 AliITSMultRecBg& operator=(const AliITSMultRecBg& src);
63 enum {kInjFakeLabel=-999};
64 enum {kInjMaxNY=10, kInjMaxNZ=8};
66 Int_t fRecType; // what to generate: normal reco, injection etc.
68 // method specific members
71 Int_t fInjLr; // injection layer
72 Int_t fInjStave; // injection stave (counted from layer)
73 Int_t fInjModule; // injection module (counted from layer)
74 Int_t fInjModInStave; // injection module (counted from stave)
75 Double_t fInjX; // injection local X
76 Double_t fInjZ; // injection local Z
77 Int_t fInjHitsN; // number of injected pixels
78 Int_t fInjHits[256]; // bit ids of injected pixels (GetPixelBitL/ExtractPixelL)
79 Int_t* fAssociations[2]; //! associations [0]: from L1 to L2, [1]: L2 to L1
80 Float_t fInjScale; // scaling factor for generation
81 Int_t fInjCurrTrial; // current trial id
82 Int_t fInjNTrials[2]; // number of injections per event for each layer
83 Int_t fInjNSuccess[2]; // number of successful injected tracklet generation
84 AliITSRecPoint fInjCluster; // fake cluster to inject
85 TH2F* fInjSPDOcc[2]; // occupancy in 2 SPD layers
86 TBits* fInjSPDPatt[2]; // occupancy pattern accounting for cluster types
87 Int_t* fInjModuleClStart[2][4]; //! start of clusters for modules in given Z belt of each stave
88 Int_t* fInjModuleClN[2][4]; //! number of clusters for modules in given Z belt of each stave
89 Int_t fInjModuleTotClN[2][4]; // total number of clusters for modules in given Z belt
90 TArrayF fInjBuffer; //! buffer for bg tracklets
92 ClassDef(AliITSMultRecBg,0)
96 inline void AliITSMultRecBg::ExtractPixelL(int id, int &stave, int &ladder, int &col, int &row) const
99 enum {kNRow=256,kNCol=32*5,kNLadd=4};