BmnRoot
Loading...
Searching...
No Matches
BmnZdcDigiScheme.h
Go to the documentation of this file.
1/*************************************************************************************
2 *
3 * Class BmnZdcDigiScheme
4 *
5 * Author: Elena Litvinenko
6 * e-mail: litvin@nf.jinr.ru
7 * Version: 18-11-2015
8 *
9 ************************************************************************************/
10
11#ifndef BMNZDCDIGISCHEME_H
12#define BMNZDCDIGISCHEME_H
13
14#include "FairGeoNode.h"
15#include "BmnZdcGeoPar.h"
16#include "BmnZdcDigiPar.h"
17
18#include "TObject.h"
19#include <map>
20#include <vector>
21
22using std::vector;
23using std::pair;
24
25 typedef std::vector<Int_t> BmnZdcVolId_t; // now - { VolumeId, MotherMotherCopyNo}
26 typedef std::vector<Int_t> BmnZdcDigiId_t; // now - {GroupID, ModuleID, ChannelID}
27 typedef std::vector<Double_t> BmnZdcVolInfo_t; // now - Center X,Y,Z; and Dx,Dy,Dz from center to the corner
28
29class BmnZdcDigiScheme: public TObject
30{
31 public:
32
35
37 Bool_t Init (BmnZdcGeoPar* geoPar, BmnZdcDigiPar* digiPar, Int_t pVerbose=0);
38
39 Bool_t AddNodes (TObjArray* sensNodes, Int_t pVerbose=0);
40 Bool_t CalcDimensions (Int_t pGlobalDetectorNumber, Int_t &nx, Int_t &ny, Int_t &nz);
41
42 BmnZdcVolId_t* CreateVolElement (FairGeoNode* nod, Int_t nodeNumber,
43 BmnZdcDigiId_t* right, Int_t pVerbose);
45 BmnZdcVolInfo_t* CreateVolInfoElement (FairGeoNode* nod, Int_t pVerbose);
47
48 Bool_t IsVolumeExist (BmnZdcVolId_t* pVolId);
50 Int_t GetGroupID (BmnZdcVolId_t* pVolId);
51 Int_t GetChannelID (BmnZdcVolId_t* pVolId);
52 Bool_t GetGroupIdModIdChanId (Int_t pMcVolumeNumber, Int_t pMcCopyNumber, Int_t pMotherCopyNumber,
53 Int_t pMotherMotherCopyNumber, Int_t &pGroupId, Int_t &pChanId, Int_t &pModId);
54
55 Bool_t GetVolCenterXYZ (BmnZdcDigiId_t* pDigiId, Double_t &x, Double_t &y,Double_t &z);
56 Bool_t GetVolDxDyDz (BmnZdcDigiId_t* pDigiId, Double_t &Dx, Double_t &Dy, Double_t &Dz);
58
59 void Print();
60 void PrintVolume (Int_t volID, Int_t copyNoMotherMother=1);
61
62 void GetZdcDimensions (Int_t &nx, Int_t &ny, Int_t &nz);
63
64 BmnZdcDigiId_t GetDigiIdFromCoords (Double_t x, Double_t y, Double_t z);
65 BmnZdcDigiId_t GetDigiIdFromVolumeData (Int_t pMcVolumeNumber, Int_t pMotherMotherCopyNumber);
66 void SplitDigiID (BmnZdcDigiId_t digiID, Int_t &module_groupID, Int_t &modID, Int_t &chanID);
67
68 inline BmnZdcDigiPar* GetZdcDigiPar() {return fZdcDigiPar;};
69
70 protected:
71
72 static BmnZdcDigiScheme* fInstance; // Instance of singleton object
73 static Int_t fRefcount; // Counter of references on this
74 static Bool_t fInitialized; // Defines whether was initialized
75
76 private:
77
78 std::map<BmnZdcVolId_t,BmnZdcDigiId_t> fVolToDigiIdMap;
79 std::map<BmnZdcDigiId_t,BmnZdcVolInfo_t*> fDigiToVolInfoMap;
80
81 Int_t Nx;
82 Int_t Ny;
83 Int_t Nz;
84
85 BmnZdcDigiPar* fZdcDigiPar;
86 TObjArray* fPasNodes;
87
88 ClassDef(BmnZdcDigiScheme,1);
89
90};
91
92#endif // BMNZDCDIGISCHEME_H
Bool_t CreateVolCopyElements(BmnZdcVolId_t *left, BmnZdcDigiId_t *right)
static Int_t fRefcount
BmnZdcVolInfo_t * GetVolInfo(BmnZdcVolId_t *pVolId)
Bool_t GetVolCenterXYZ(BmnZdcDigiId_t *pDigiId, Double_t &x, Double_t &y, Double_t &z)
virtual ~BmnZdcDigiScheme()
Bool_t AddNodes(TObjArray *sensNodes, Int_t pVerbose=0)
static BmnZdcDigiScheme * Instance()
Bool_t Init(BmnZdcGeoPar *geoPar, BmnZdcDigiPar *digiPar, Int_t pVerbose=0)
void PrintVolume(Int_t volID, Int_t copyNoMotherMother=1)
void SplitDigiID(BmnZdcDigiId_t digiID, Int_t &module_groupID, Int_t &modID, Int_t &chanID)
static BmnZdcDigiScheme * fInstance
BmnZdcDigiId_t GetDigiId(BmnZdcVolId_t *pVolId)
Bool_t CreateVolInfoCopyElements(BmnZdcDigiId_t *right, BmnZdcVolInfo_t *volInfo)
Bool_t CalcDimensions(Int_t pGlobalDetectorNumber, Int_t &nx, Int_t &ny, Int_t &nz)
Bool_t GetVolDxDyDz(BmnZdcDigiId_t *pDigiId, Double_t &Dx, Double_t &Dy, Double_t &Dz)
BmnZdcDigiId_t GetDigiIdFromVolumeData(Int_t pMcVolumeNumber, Int_t pMotherMotherCopyNumber)
BmnZdcDigiId_t GetDigiIdFromCoords(Double_t x, Double_t y, Double_t z)
Bool_t IsVolumeExist(BmnZdcVolId_t *pVolId)
Int_t GetChannelID(BmnZdcVolId_t *pVolId)
BmnZdcDigiPar * GetZdcDigiPar()
BmnZdcVolInfo_t * CreateVolInfoElement(FairGeoNode *nod, Int_t pVerbose)
Int_t GetGroupID(BmnZdcVolId_t *pVolId)
Bool_t GetGroupIdModIdChanId(Int_t pMcVolumeNumber, Int_t pMcCopyNumber, Int_t pMotherCopyNumber, Int_t pMotherMotherCopyNumber, Int_t &pGroupId, Int_t &pChanId, Int_t &pModId)
void GetZdcDimensions(Int_t &nx, Int_t &ny, Int_t &nz)
static Bool_t fInitialized
BmnZdcVolId_t * CreateVolElement(FairGeoNode *nod, Int_t nodeNumber, BmnZdcDigiId_t *right, Int_t pVerbose)
std::vector< Double_t > BmnZdcVolInfo_t
std::vector< Int_t > BmnZdcVolId_t
std::vector< Int_t > BmnZdcDigiId_t