FairRoot/PandaRoot
PndTrkGemHitList.cxx
Go to the documentation of this file.
1 //
2 // PndTrkGemHitList.cxx
3 //
4 //
5 // authors: Lia Lavezzi - INFN Pavia (2012)
6 //
7 
8 #include "PndTrkGemHitList.h"
9 
10 #include "PndDetectorList.h"
11 
12 #include <iostream>
13 
14 
15 using namespace std;
16 
17 // ------------------ instance --------------------------
19 
21 {
22  if(!fgemInstance) cout << "NO PndTrkGemHitList: you must fill gem hit list BEFORE doing what you are doing!" << endl;
23  return fgemInstance;
24 }
25 
27  fgemInstance = this;
28  return fgemInstance;
29 }
30 
31 // ------------------ instance ---------------------------
32 
34 
35 PndTrkGemHitList::PndTrkGemHitList(Int_t iregion) : PndTrkHitList(), fIRegion(iregion) {}
36 
38  fgemInstance = 0;
39 }
40 
41 void PndTrkGemHitList::AddHit(Int_t hitid, Int_t detid, FairHit *hit)
42 {
43  TVector3 position;
44  hit->Position(position);
45  int station = ((PndGemHit*) hit)->GetStationNr();
46  int sensor = ((PndGemHit*) hit)->GetSensorNr();
47 
48 
49  // layerid = 0, 1, 2, ...
50  int layerid = 2 * station + sensor - 3;
51 
52 
53  PndTrkHitList::AddHit(hitid, detid, 0, GEM, layerid, position); // CHECK iregion
54 }
55 
56 void PndTrkGemHitList::AddNonCombiHits(Int_t detID, TClonesArray *array, std::map< int, bool > hitTousable) {
57  for(int ihit = 0; ihit < array->GetEntriesFast(); ihit++) {
58  PndGemHit *hit = (PndGemHit*) array->At(ihit);
59  if(hitTousable[ihit] == false) continue;
60  AddHit(ihit, detID, hit);
61  }
62 }
63 
65 
void AddHit(Int_t hitid, Int_t detid, FairHit *hit)
TGeoVolume * sensor
void AddNonCombiHits(Int_t detID, TClonesArray *array, std::map< int, bool > hitTousable)
static PndTrkGemHitList * fgemInstance
#define GEM
static PndTrkGemHitList * Instance()
PndTrkGemHitList * Instanciate()
void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, TVector3 &pos)
ClassImp(PndAnaContFact)
PndSdsMCPoint * hit
Definition: anasim.C:70