| 1 |
#ifndef PAMVMCCALOSD_H |
| 2 |
#define PAMVMCCALOSD_H |
| 3 |
#include <iostream> |
| 4 |
|
| 5 |
#include "PamVMCDetectorSD.h" |
| 6 |
|
| 7 |
#define NOCALHIT 4224 |
| 8 |
|
| 9 |
using std::cout; |
| 10 |
using std::endl; |
| 11 |
|
| 12 |
class PamVMCCaloSD: public PamVMCDetectorSD{ |
| 13 |
|
| 14 |
|
| 15 |
public: |
| 16 |
PamVMCCaloSD(): PamVMCDetectorSD("PamVMCDetectorHit","CAST",NOCALHIT){ |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
virtual void FillHit(fin f,TVirtualMC *g){ |
| 22 |
|
| 23 |
switch(f) { |
| 24 |
case ENTERING: |
| 25 |
CleanHit(); |
| 26 |
FillVolID(); |
| 27 |
InitHit(); |
| 28 |
|
| 29 |
default: |
| 30 |
UpdateHit(g); |
| 31 |
break; |
| 32 |
} |
| 33 |
|
| 34 |
switch(f){ |
| 35 |
case EXITING: |
| 36 |
|
| 37 |
// Save hit if energy release is greater than zero |
| 38 |
if(fhit->GetEREL()){ |
| 39 |
if(fdetID->FillVolID()){ |
| 40 |
|
| 41 |
SaveHit(fdetID->GetID( )); |
| 42 |
|
| 43 |
} else { |
| 44 |
cout << "Calorimeter FillVolID false" <<endl; |
| 45 |
} |
| 46 |
} |
| 47 |
break; |
| 48 |
default: |
| 49 |
break; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
Int_t GetPlaneID(){ |
| 54 |
return ((int)fhit->GetPOS()/192); |
| 55 |
} |
| 56 |
|
| 57 |
Int_t GetViewID(){ |
| 58 |
return ((int)fhit->GetPOS()/96%2==0?0:1); |
| 59 |
} |
| 60 |
Int_t GetStripID(){ |
| 61 |
return (fhit->GetPOS()%96); |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
ClassDef(PamVMCCaloSD,1) |
| 67 |
|
| 68 |
}; |
| 69 |
|
| 70 |
#endif // PAMVMCCALOSD_H |