1 |
#ifndef PAMVMCTRKID_H |
2 |
#define PAMVMCTRKID_H |
3 |
#include <iostream> |
4 |
#include "TVirtualMC.h" |
5 |
#include "pGeoID.h" |
6 |
|
7 |
#define TRKOF 2 |
8 |
|
9 |
using std::cout; |
10 |
using std::endl; |
11 |
|
12 |
struct pTrkID: public pGeoID { |
13 |
Int_t plNo; |
14 |
Int_t padNo; |
15 |
|
16 |
|
17 |
pTrkID(): plNo(-1), padNo(-1) {}; |
18 |
pTrkID(Int_t offset): pGeoID(offset), plNo(-1), padNo(-1) {}; |
19 |
pTrkID & operator = (const pTrkID &pid) { |
20 |
plNo=pid.plNo; |
21 |
padNo=pid.padNo; |
22 |
return *this; |
23 |
} |
24 |
|
25 |
Bool_t FillVolID(){ |
26 |
Bool_t t=kFALSE; |
27 |
if(gMC) { |
28 |
Int_t TRPB; |
29 |
gMC->CurrentVolOffID(3,TRPB); |
30 |
TRPB==2 ? plNo=6 : gMC->CurrentVolOffID(4,plNo); |
31 |
gMC->CurrentVolOffID(1,padNo); |
32 |
t= kTRUE; |
33 |
//cout<<"plNo: "<<plNo<<" Pad: "<<padNo<<endl; |
34 |
//Print(); |
35 |
//} |
36 |
} |
37 |
return t; |
38 |
} |
39 |
|
40 |
Int_t GetID() const { return (plNo-1)*6+padNo; } |
41 |
|
42 |
void Print(const Option_t* ="") const { |
43 |
cout << " pTrkID : plNo " << plNo <<endl; |
44 |
cout << " pTrkID : padNo " << plNo <<endl; |
45 |
} |
46 |
|
47 |
}; |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
#endif // PAMVMCTrkID_H |