/[PAMELA software]/PamCAL/include/PamVMCCaloID.h
ViewVC logotype

Contents of /PamCAL/include/PamVMCCaloID.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Nov 12 10:10:18 2007 UTC (17 years ago) by nikolas
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
More basic files added

1 #ifndef PAMVMCCALOID_H
2 #define PAMVMCCALOID_H
3 #include <iostream>
4 #include "TVirtualMC.h"
5 #include "pGeoID.h"
6
7 #define CALSD "CAST"
8 #define CALOF 3
9
10 using std::cout;
11 using std::endl;
12
13 struct pCalID: public pGeoID {
14 Int_t casiNo;
15 Int_t caplNo;
16 Int_t castNo;
17
18 pCalID(): casiNo(-1), caplNo(-1), castNo(-1) {};
19 pCalID(Int_t offset): pGeoID(offset), casiNo(-1), caplNo(-1), castNo(-1) {};
20 pCalID & operator = (const pCalID &pid) {
21 casiNo=pid.casiNo;
22 caplNo=pid.caplNo;
23 castNo=pid.castNo;
24 return *this;
25 }
26
27 Bool_t FillVolID(){
28 Bool_t t=kFALSE;
29 if(gMC) {
30 // if(gMC->CurrentEvent()){
31 gMC->CurrentVolID(castNo);
32 gMC->CurrentVolOffID(1,casiNo);
33 gMC->CurrentVolOffID(2,caplNo);
34 t= kTRUE;
35 //Print();
36 //}
37 }
38 return t;
39 }
40
41 Int_t GetID() const {
42 Int_t fact;
43 switch(casiNo){
44 case 1:
45 case 4:
46 case 7:
47 fact=0;
48 break;
49 case 2:
50 case 5:
51 case 8:
52 fact=32;
53 break;
54 case 3:
55 case 6:
56 case 9:
57 fact=64;
58 break;
59 default:
60 fact=0;
61 break;
62 }
63 return (caplNo-1)*96+fact+castNo;
64 }
65
66 void Print(const Option_t* ="") const {
67 cout << " pCalID : castNo " << castNo
68 << ", casiNo " << casiNo << ", caplNo " << caplNo
69 << ", actual POS " << GetID() << endl;
70 }
71
72 };
73
74 // class PamVMCCaloID: public PamVMCGeoID {
75
76 // private:
77
78 // pCalID fcalid;
79
80 // public:
81 // PamVMCCaloID() : PamVMCGeoID(CALSD ,CALOF) {};
82 // void FillVolID(pGeoID *gid){ fcalid = *(pCalID *)gid; };
83
84 // //ClassDef(PamVMCCaloID,1)
85
86 // };
87
88
89 #endif // PAMVMCCALOID_H

  ViewVC Help
Powered by ViewVC 1.1.23