28 #include <TClonesArray.h>
31 #include <TMathBase.h>
70 fNHits = fHits->GetEntriesFast();
72 LOG(debug) <<
"PixelFindTracks::Exec() EVENT " << fTNofEvents <<
" with " << fNHits <<
" HITS";
85 for (Int_t ihit1 = 0; ihit1 < fNHits; ihit1++) {
86 curHit1 =
static_cast<PixelHit*
>(fHits->At(ihit1));
87 LOG(debug) <<
"hit1 at " << curHit1->
GetX() <<
" , " << curHit1->
GetY() <<
" , " << curHit1->
GetZ() <<
" / "
91 for (Int_t ihit2 = 0; ihit2 < fNHits; ihit2++) {
92 curHit2 =
static_cast<PixelHit*
>(fHits->At(ihit2));
93 LOG(debug) <<
"hit2 at " << curHit2->
GetX() <<
" , " << curHit2->
GetY() <<
" , " << curHit2->
GetZ() <<
" / "
98 parAX = (curHit2->
GetX() - curHit1->
GetX()) / (curHit2->
GetZ() - curHit1->
GetZ());
99 parAY = (curHit2->
GetY() - curHit1->
GetY()) / (curHit2->
GetZ() - curHit1->
GetZ());
100 parX0 = curHit1->
GetX() - parAX * curHit1->
GetZ();
101 parY0 = curHit1->
GetY() - parAY * curHit1->
GetZ();
103 for (Int_t ihit3 = 0; ihit3 < fNHits; ihit3++) {
104 curHit3 =
static_cast<PixelHit*
>(fHits->At(ihit3));
105 LOG(debug) <<
"hit3 at " << curHit3->
GetX() <<
" , " << curHit3->
GetY() <<
" , " << curHit3->
GetZ()
109 expX = parX0 + parAX * curHit3->
GetZ();
110 expY = parY0 + parAY * curHit3->
GetZ();
112 fhDist2D->Fill(expX - curHit3->
GetX(), expY - curHit3->
GetY());
114 if (TMath::Abs(expX - curHit3->
GetX()) < 0.03 && TMath::Abs(expY - curHit3->
GetY()) < 0.03) {
115 LOG(debug) <<
"should create track...";
117 new ((*fTracks)[fNTracks])
PixelTrack(parX0, parAX, parY0, parAY, 0., 0., 0., 0.);
121 LOG(debug) <<
"--> " << fNTracks;
132 fTNofTracks += fNTracks;
135 void PixelFindTracks::SetParContainers()
140 LOG(fatal) <<
"No analysis run";
144 LOG(fatal) <<
"No runtime database";
153 tempList->Add(fDigiPar);
160 LOG(info) <<
"********************************************** PixelFindTracks::InitMQ()";
161 fDigiPar = (
PixelDigiPar*)tempList->FindObject(
"PixelDigiParameters");
163 fTracks =
new TClonesArray(
"PixelTrack", 10000);
164 fhDist2D =
new TH2F(
"fhDist2D",
"Distance between hit and expected track", 400, -1., 1., 400, -1., 1.);
175 fHits = (TClonesArray*)inputList->FindObject(
"PixelHits");
176 outputList->Add(fTracks);
187 LOG(fatal) <<
"No FairRootManager";
188 fHits =
static_cast<TClonesArray*
>(ioman->
GetObject(
"PixelHits"));
191 LOG(warn) <<
"PixelFindTracks::Init() No input PixelHit array!";
194 fTracks =
new TClonesArray(
"PixelTrack", 10000);
195 ioman->
Register(
"PixelTracks",
"Pixel", fTracks, kTRUE);
197 fhDist2D =
new TH2F(
"fhDist2D",
"Distance between hit and expected track", 400, -1., 1., 400, -1., 1.);
204 void PixelFindTracks::Reset()
206 fNTracks = fNHits = 0;
211 void PixelFindTracks::Finish()
216 fhDist2D->Draw(
"colz");
218 LOG(info) <<
"-------------------- " << fName.Data() <<
" : Summary ------------------------";
219 LOG(info) <<
" Events: " << fTNofEvents;
220 LOG(info) <<
" Hits: " << fTNofHits <<
" ( "
221 <<
static_cast<Double_t
>(fTNofHits) / (static_cast<Double_t>(fTNofEvents)) <<
" per event )";
222 LOG(info) <<
" Tracks: " << fTNofTracks <<
" ( "
223 <<
static_cast<Double_t
>(fTNofTracks) / (static_cast<Double_t>(fTNofEvents)) <<
" per event )";
224 LOG(info) <<
"---------------------------------------------------------------------";
list of container factories
void AddHitIndex(Int_t hitIndex)
virtual ~PixelFindTracks()
virtual void Exec(Option_t *opt)
static FairRun * Instance()
virtual void GetParList(TList *tempList)
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
Digitization Parameter Class for Pixel detector.
TObject * GetObject(const char *BrName)
FairParSet * getContainer(const Text_t *)
Int_t GetDetectorID() const
virtual void InitMQ(TList *tempList)
FairRuntimeDb * GetRuntimeDb(void)
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
virtual void ExecMQ(TList *inputList, TList *outputList)