FairRoot/PandaRoot
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PndGemMonitor Class Reference

Digitization Parameter Class for GEM part. More...

#include <PndGemMonitor.h>

Inheritance diagram for PndGemMonitor:

Public Member Functions

 PndGemMonitor ()
 
virtual ~PndGemMonitor ()
 
Double_t ChannelLastActiveAt (Int_t statNr, Int_t sensNr, Int_t sideId, Int_t chanNr)
 
Int_t CreateSensorMonitor (const PndGemSensor &tempSensor)
 
void EnableDigi (Int_t eventNr, Int_t digiNr, PndGemDigi *tempDigi)
 
void EnableCluster (Int_t eventNr, Int_t clusterNr, PndGemCluster *tempCluster)
 
void Print ()
 

Static Public Member Functions

static PndGemMonitorInstance ()
 
static void Destroy ()
 

Private Member Functions

 PndGemMonitor (PndGemMonitor &)
 
 ClassDef (PndGemMonitor, 1)
 

Private Attributes

TGeoManager * fGeoMan
 
FairRuntimeDb * fRtdb
 
TObjArray * fSensorList
 
std::map< std::pair< Int_t,
Int_t >, Int_t > 
fSensorMap
 

Static Private Attributes

static PndGemMonitorfInstance = NULL
 

Detailed Description

Digitization Parameter Class for GEM part.

PndGemMonitor

Author
Radoslaw Karabowicz r.kar.nosp@m.abow.nosp@m.icz@g.nosp@m.si.d.nosp@m.e
Since
10.04.2013
Version
1.0

PANDA task class for monitoring GEM

Definition at line 36 of file PndGemMonitor.h.

Constructor & Destructor Documentation

PndGemMonitor::PndGemMonitor ( )

Definition at line 42 of file PndGemMonitor.cxx.

References fInstance, run, SetName, and SetTitle().

Referenced by Instance().

42  :
43  FairTask("GEM Monitor",0),
44  fGeoMan(),
45  fRtdb(),
46  fSensorList(NULL)
47  //,
48  // fSensorMap(0)
49 {
50  if(fInstance) return;
51  fInstance = this;
52  FairRun* run = FairRun::Instance();
53  if (run) {
54  this->SetName("PndGemMonitor");
55  this->SetTitle("FairTask");
56  run->AddTask((FairTask*)this);
57  }
58  else {
59  std::cout << "PndGemMonitor. No FairRun object found. If used in a macro take another constructor." << std::endl;
60  }
61 }
static PndGemMonitor * fInstance
Definition: PndGemMonitor.h:59
cout<< "-----------------------------------------------> Quarter VOLUME<<endl;name="QuarterShape";QuarterShape=newTGeoArb8(name,dz,vertQuar);name="Quarter4Vol";TStringmedium="air";QuarterVol=newTGeoVolumeAssembly(name);name="SubunitShape";SubunitShape=newTGeoArb8(name,dz,vertSub);TStringmedium="air";name="SubunitVol";name1="SubunitVol1";name2="SubunitVol2";name3="SubunitVol3";name4="SubunitVol4";name5="SubunitVol5";name6="SubunitVol6";name7="SubunitVol7";name8="SubunitVol8";name9="SubunitVol9";SubunitVol=newTGeoVolumeAssembly(name);SubunitVol1=newTGeoVolumeAssembly(name1);SubunitVol2=newTGeoVolumeAssembly(name2);SubunitVol3=newTGeoVolumeAssembly(name3);SubunitVol4=newTGeoVolumeAssembly(name4);SubunitVol5=newTGeoVolumeAssembly(name5);SubunitVol6=newTGeoVolumeAssembly(name6);SubunitVol7=newTGeoVolumeAssembly(name7);SubunitVol8=newTGeoVolumeAssembly(name8);SubunitVol9=newTGeoVolumeAssembly(name9);name="BoxShape";BoxShape=newTGeoArb8(name,dz,vertBox);TStringmedium="air";name="BoxVol";BoxVol=newTGeoVolumeAssembly(name);name1="BoxVol1";name2="BoxVol2";name3="BoxVol3";name4="BoxVol4";BoxVol1=newTGeoVolumeAssembly(name1);BoxVol2=newTGeoVolumeAssembly(name2);BoxVol3=newTGeoVolumeAssembly(name3);BoxVol4=newTGeoVolumeAssembly(name4);for(Int_tb=0;b<kNumOfBoxes;b++){cout<<""<<endl;cout<<"---------------->BOXnumber:"<<b<<endl;if(b==0){trBox=newTGeoTranslation(tr+kSpaceInSub+kAlveoleThickness+0.5*kSpaceInBox,tr+kSpaceInSub+kAlveoleThickness+0.5*kSpaceInBox,0.);rotBox=newTGeoRotation();rotBox.RotateX(0.465518);rotBox.RotateY(-0.465518);}if(b==1){trBox=newTGeoTranslation(-tr-kSpaceInSub-kAlveoleThickness-0.5*kSpaceInBox,-tr-kSpaceInSub-kAlveoleThickness-0.5*kSpaceInBox,0.);rotBox=newTGeoRotation();rotBox.RotateX(-0.465518);rotBox.RotateY(0.465518);}if(b==2){trBox=newTGeoTranslation(tr+kSpaceInSub+kAlveoleThickness+0.5*kSpaceInBox,-tr-kSpaceInSub-kAlveoleThickness-0.5*kSpaceInBox,0.);rotBox=newTGeoRotation();rotBox.RotateX(-0.465518);rotBox.RotateY(-0.465518);}if(b==3){trBox=newTGeoTranslation(-tr-kSpaceInSub-kAlveoleThickness-0.5*kSpaceInBox,tr+kSpaceInSub+kAlveoleThickness+0.5*kSpaceInBox,0.);rotBox=newTGeoRotation();rotBox.RotateX(0.465518);rotBox.RotateY(0.465518);}TGeoCombiTrans*trrotBox=newTGeoCombiTrans(trBox,rotBox);name="BoxVol";name+=b;trrotBox->SetName(name);trrotBox->RegisterYourself();SubunitVol->AddNode(BoxVol,b,trrotBox);if(b==1){name+=b;trrotBox->SetName(name);trrotBox->RegisterYourself();SubunitVol1->AddNode(BoxVol,b,trrotBox);}if(b==2){name+=b;trrotBox->SetName(name);trrotBox->RegisterYourself();SubunitVol2->AddNode(BoxVol1,b,trrotBox);}if(b==0){name+=b;trrotBox-> SetName(name)
Int_t run
Definition: autocutx.C:47
FairRuntimeDb * fRtdb
Definition: PndGemMonitor.h:64
h_MC_angle SetTitle("MC truth: opening angle of #pi^{0}")
TObjArray * fSensorList
Definition: PndGemMonitor.h:66
TGeoManager * fGeoMan
Definition: PndGemMonitor.h:63
virtual PndGemMonitor::~PndGemMonitor ( )
inlinevirtual

Definition at line 49 of file PndGemMonitor.h.

49 {};
PndGemMonitor::PndGemMonitor ( PndGemMonitor )
inlineprivate

Definition at line 60 of file PndGemMonitor.h.

60  : FairTask() // gm //[R.K.03/2017] unused variable(s)
61  {}

Member Function Documentation

Double_t PndGemMonitor::ChannelLastActiveAt ( Int_t  statNr,
Int_t  sensNr,
Int_t  sideId,
Int_t  chanNr 
)

Definition at line 112 of file PndGemMonitor.cxx.

References a, PndGemSensorMonitor::ChannelLastActiveAt(), fSensorList, fSensorMap, and sensor.

Referenced by PndGemFindHits::ConfirmHits().

112  {
113  pair<Int_t, Int_t> a (statNr,sensNr);
115  // cout << "sensor is there " << sensor << " :" << endl;
116 
117  return sensor->ChannelLastActiveAt(chanNr,sideId);
118 }
Double_t ChannelLastActiveAt(Int_t channelNr, Int_t sideId, Double_t timeNow, Int_t eventNr=-1)
TGeoVolume * sensor
Int_t a
Definition: anaLmdDigi.C:126
TObjArray * fSensorList
Definition: PndGemMonitor.h:66
std::map< std::pair< Int_t, Int_t >, Int_t > fSensorMap
Definition: PndGemMonitor.h:67
PndGemMonitor::ClassDef ( PndGemMonitor  ,
 
)
private

map of stationNr,sensorNr to sensor

Int_t PndGemMonitor::CreateSensorMonitor ( const PndGemSensor tempSensor)

Definition at line 65 of file PndGemMonitor.cxx.

References a, fSensorList, fSensorMap, PndGemSensor::GetSensorNr(), and PndGemSensor::GetStationNr().

Referenced by PndGemFindHits::Init().

65  {
66  if ( fSensorList == 0 )
67  fSensorList = new TObjArray();
68 
69  PndGemSensorMonitor* tempMonitor = new PndGemSensorMonitor(tempSensor);
70 
71  pair<Int_t, Int_t> a (tempMonitor->GetStationNr(),
72  tempMonitor->GetSensorNr ());
73  fSensorMap[a] = fSensorList->GetEntries();
74  fSensorList->Add(tempMonitor);
75  return 0; // ADDED, not clear the meaning of this Int_t function (Stefano)
76 }
Int_t GetStationNr() const
Definition: PndGemSensor.h:93
Int_t a
Definition: anaLmdDigi.C:126
TObjArray * fSensorList
Definition: PndGemMonitor.h:66
Int_t GetSensorNr() const
Definition: PndGemSensor.h:95
std::map< std::pair< Int_t, Int_t >, Int_t > fSensorMap
Definition: PndGemMonitor.h:67
static void PndGemMonitor::Destroy ( )
inlinestatic

Definition at line 42 of file PndGemMonitor.h.

References fInstance.

42  {
43  if (fInstance){
44  delete fInstance;
45  fInstance = 0;
46  }
47  }
static PndGemMonitor * fInstance
Definition: PndGemMonitor.h:59
void PndGemMonitor::EnableCluster ( Int_t  eventNr,
Int_t  clusterNr,
PndGemCluster tempCluster 
)

Definition at line 122 of file PndGemMonitor.cxx.

References a, fSensorList, fSensorMap, PndGemCluster::GetCharge(), PndGemCluster::GetClusterBeg(), PndGemCluster::GetClusterEnd(), PndGemCluster::GetSensorNr(), PndGemCluster::GetSide(), PndGemCluster::GetStationNr(), and sensor.

Referenced by PndGemFindHits::ActivateDigis().

122  {
123  pair<Int_t, Int_t> a (tempCluster->GetStationNr(),
124  tempCluster->GetSensorNr ());
126 
127  for ( Int_t ichan = tempCluster->GetClusterBeg() ; ichan <= tempCluster->GetClusterEnd() ; ichan++ ) {
128  sensor->ActivateChannel(ichan,
129  tempCluster->GetSide(),
130  eventNr,
131  clusterNr,
132  tempCluster->GetTimeStamp(),
133  tempCluster->GetCharge());
134  }
135 }
Int_t GetSensorNr() const
Definition: PndGemCluster.h:90
Int_t GetClusterBeg() const
Definition: PndGemCluster.h:95
Int_t GetSide() const
Definition: PndGemCluster.h:92
TGeoVolume * sensor
Int_t a
Definition: anaLmdDigi.C:126
Int_t GetClusterEnd() const
Definition: PndGemCluster.h:96
TObjArray * fSensorList
Definition: PndGemMonitor.h:66
std::map< std::pair< Int_t, Int_t >, Int_t > fSensorMap
Definition: PndGemMonitor.h:67
Double_t GetCharge() const
Definition: PndGemCluster.h:97
Int_t GetStationNr() const
Definition: PndGemCluster.h:88
void PndGemMonitor::EnableDigi ( Int_t  eventNr,
Int_t  digiNr,
PndGemDigi tempDigi 
)

Definition at line 80 of file PndGemMonitor.cxx.

References a, fSensorList, fSensorMap, PndGemDigi::GetChannelNr(), PndGemDigi::GetCharge(), PndGemDigi::GetSensorNr(), PndGemDigi::GetSide(), PndGemDigi::GetStationNr(), and sensor.

80  {
81  pair<Int_t, Int_t> a (tempDigi->GetStationNr(),
82  tempDigi->GetSensorNr ());
84 
85  // sensor->ChannelLastActiveAt(tempDigi->GetChannelNr(),
86  // tempDigi->GetSide(),
87  // tempDigi->GetTimeStamp(),
88  // eventNr);
89 
90  sensor->ActivateChannel(tempDigi->GetChannelNr(),
91  tempDigi->GetSide(),
92  eventNr,
93  digiNr,
94  tempDigi->GetTimeStamp(),
95  tempDigi->GetCharge());
96 
97 
98  // // ----- How much time passed since last activation? ----------------------------------------------------
99  // Double_t PndGemSensorMonitor::ChannelLastActiveAt(Int_t channelNr, Int_t sideId, Double_t timeNow) {
100  // }
101  // // -------------------------------------------------------------------------
102 
103  // // ----- Last activation data ----------------------------------------------------
104  // Bool_t PndGemSensorMonitor::ChannelLastActivation(Int_t channelNr, Int_t sideId, Int_t& eventNr, Int_t& digiNr, Double_t& channelTime, Double_t& channelCharge) {
105  // }
106  // // -------------------------------------------------------------------------
107 
108 }
Int_t GetStationNr() const
Definition: PndGemDigi.h:84
TGeoVolume * sensor
Int_t GetSensorNr() const
Definition: PndGemDigi.h:86
Int_t a
Definition: anaLmdDigi.C:126
Double_t GetChannelNr() const
Definition: PndGemDigi.h:80
TObjArray * fSensorList
Definition: PndGemMonitor.h:66
Double_t GetCharge() const
Definition: PndGemDigi.h:91
std::map< std::pair< Int_t, Int_t >, Int_t > fSensorMap
Definition: PndGemMonitor.h:67
Int_t GetSide() const
Definition: PndGemDigi.h:88
PndGemMonitor * PndGemMonitor::Instance ( )
static

Definition at line 32 of file PndGemMonitor.cxx.

References fInstance, and PndGemMonitor().

Referenced by PndGemFindHits::Init().

32  {
33  if ( !fInstance){
34  std::cout<<"Info in (PndGemMonitor::Instance): Making a new instance using the framework."<<std::endl;
35  fInstance = new PndGemMonitor();
36  }
37  return fInstance;
38 }
static PndGemMonitor * fInstance
Definition: PndGemMonitor.h:59
void PndGemMonitor::Print ( )

Definition at line 139 of file PndGemMonitor.cxx.

References fSensorList.

139  {
140  std::cout << "--- PndGemMonitor :: Print () ---" << std::endl;
141  std::cout << "--- " << fSensorList->GetEntries() << " sensors" << std::endl;
142  for ( Int_t isens = 0 ; isens < fSensorList->GetEntries() ; isens++ ) {
143  ((PndGemSensorMonitor*)fSensorList->At(isens))->Print();
144  }
145 
146  std::cout << "---------------------------------" << std::endl;
147 }
TObjArray * fSensorList
Definition: PndGemMonitor.h:66

Member Data Documentation

TGeoManager* PndGemMonitor::fGeoMan
private

Definition at line 63 of file PndGemMonitor.h.

PndGemMonitor * PndGemMonitor::fInstance = NULL
staticprivate

Definition at line 59 of file PndGemMonitor.h.

Referenced by Destroy(), Instance(), and PndGemMonitor().

FairRuntimeDb* PndGemMonitor::fRtdb
private

Definition at line 64 of file PndGemMonitor.h.

TObjArray* PndGemMonitor::fSensorList
private
std::map<std::pair<Int_t, Int_t>, Int_t> PndGemMonitor::fSensorMap
private

list of sensor monitors

Definition at line 67 of file PndGemMonitor.h.

Referenced by ChannelLastActiveAt(), CreateSensorMonitor(), EnableCluster(), and EnableDigi().


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