1 |
nikolas |
1.1 |
#ifndef PAMVMCTOFSD_H |
2 |
|
|
#define PAMVMCTOFSD_H |
3 |
|
|
#include <iostream> |
4 |
|
|
|
5 |
|
|
#include "PamVMCDetectorSD.h" |
6 |
|
|
|
7 |
|
|
using std::cout; |
8 |
|
|
using std::endl; |
9 |
|
|
|
10 |
|
|
class PamVMCTofSD: public PamVMCDetectorSD{ |
11 |
|
|
|
12 |
|
|
const char* cname; |
13 |
|
|
|
14 |
|
|
public: |
15 |
|
|
PamVMCTofSD(char *dname):PamVMCDetectorSD("pHitData",dname,1000) |
16 |
|
|
{ |
17 |
|
|
cname=dname; |
18 |
|
|
}; |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
virtual void FillHit(fin f,TVirtualMC *g){ |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
switch(f) { |
25 |
|
|
case ENTERING: |
26 |
|
|
|
27 |
|
|
CleanHit(); |
28 |
|
|
FillVolID(); |
29 |
|
|
InitHit(); |
30 |
|
|
|
31 |
|
|
default: |
32 |
|
|
UpdateHit(g); |
33 |
|
|
|
34 |
|
|
cout<<"NEW HIT ENTERING OR INSIDE "<<fnohit<<" in "<<cname<<" PDG="<<fhit.GetPDG()<<" GT "<<g->GetStack()->GetCurrentTrack()->T()<<" fTOF is: "<<fhit.GetTOF()<<endl; |
35 |
|
|
break; |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
switch(f){ |
39 |
|
|
case EXITING: |
40 |
|
|
//// // Save hit if energy release is greater than zero |
41 |
|
|
UpdateHit(g); |
42 |
|
|
if(fhit.GetEREL()){ |
43 |
|
|
if(fdetID->FillVolID()){ |
44 |
|
|
// AddGlobalTime(g); |
45 |
|
|
//cout<<"saving"<<fdetID->GetID()<<endl; |
46 |
|
|
cout<<"NEW HIT EXITING "<<fnohit<<" in "<<cname<<" PDG="<<fhit.GetPDG()<<" at"<<fhit.GetTOF()<<" GT "<<g->GetStack()->GetCurrentTrack()->T() <<endl; |
47 |
|
|
SaveHit(cname); |
48 |
|
|
} else { |
49 |
|
|
cout << "TOF FillVolID false" <<endl; |
50 |
|
|
} |
51 |
|
|
} |
52 |
|
|
break; |
53 |
|
|
default: |
54 |
|
|
break; |
55 |
|
|
} |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
ClassDef(PamVMCTofSD,1) |
59 |
|
|
|
60 |
|
|
}; |
61 |
|
|
|
62 |
|
|
#endif // PAMVMCTOFSD_H |