| 1 | nikolas | 1.1 | #ifndef PAMVMCTRKSD_H | 
| 2 |  |  | #define PAMVMCTRKSD_H | 
| 3 |  |  | #include <iostream> | 
| 4 |  |  |  | 
| 5 |  |  | #include "PamVMCDetectorSD.h" | 
| 6 |  |  |  | 
| 7 |  |  | using std::cout; | 
| 8 |  |  | using std::endl; | 
| 9 |  |  |  | 
| 10 |  |  | class PamVMCTrkSD: public PamVMCDetectorSD{ | 
| 11 |  |  |  | 
| 12 |  |  |  | 
| 13 |  |  |  | 
| 14 |  |  | public: | 
| 15 |  |  | PamVMCTrkSD():PamVMCDetectorSD("pHitData","TSPA",1000) | 
| 16 |  |  | { | 
| 17 |  |  |  | 
| 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 |  |  | cout<<"plane "<<GetPlaneID()<<" pad "<<GetPadID(); | 
| 34 |  |  | cout<<" NEW HIT ENTERING OR  INSIDE "<<fnohit<<" PDG="<<fhit.GetPDG()<<" at "<<g->TrackTime()<<" 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 |  |  | cout<<"plane "<<GetPlaneID()<<" pad "<<GetPadID(); | 
| 45 |  |  | cout<<" NEW HIT EXITING "<<fnohit<<" PDG="<<fhit.GetPDG()<<" at "<<g->TrackTime()<<" fTOF is: "<<fhit.GetTOF()<<endl; | 
| 46 |  |  | SaveHit("TSPA"); | 
| 47 |  |  | } else { | 
| 48 |  |  | cout << "TOF FillVolID false" <<endl; | 
| 49 |  |  | } | 
| 50 |  |  | } | 
| 51 |  |  | break; | 
| 52 |  |  | default: | 
| 53 |  |  | break; | 
| 54 |  |  | } | 
| 55 |  |  | } | 
| 56 |  |  |  | 
| 57 |  |  | */ | 
| 58 |  |  | Int_t GetPlaneID(){ | 
| 59 |  |  | return ((int)fhit.GetPOS()/6+1); | 
| 60 |  |  | } | 
| 61 |  |  |  | 
| 62 |  |  | Int_t GetPadID(){ | 
| 63 |  |  | return (fhit.GetPOS()-(GetPlaneID()-1)*6); | 
| 64 |  |  | } | 
| 65 |  |  |  | 
| 66 |  |  | ClassDef(PamVMCTrkSD,1) | 
| 67 |  |  |  | 
| 68 |  |  | }; | 
| 69 |  |  |  | 
| 70 |  |  | #endif // PAMVMCTRKSD_H |