SND@LHC Software
Loading...
Searching...
No Matches
vetoHit.cxx
Go to the documentation of this file.
1#include "vetoHit.h"
2#include "veto.h"
3#include "TVector3.h"
4#include "FairRun.h"
5#include "FairRunSim.h"
6#include "TMath.h"
7#include "TRandom1.h"
8#include "TRandom3.h"
9#include "TGeoManager.h"
10#include "TGeoArb8.h"
11
12#include <iostream>
13#include <math.h>
14using std::cout;
15using std::endl;
16
17Double_t speedOfLight = TMath::C() *100./1000000000.0 ; // from m/sec to cm/ns
18// ----- Default constructor -------------------------------------------
20 : ShipHit()
21{
22 flag = true;
23}
24// ----- Standard constructor ------------------------------------------
25vetoHit::vetoHit(Int_t detID, Float_t adc)
26 : ShipHit(detID,adc)
27{
28 ft = -1;
29 flag = true;
30}
31
32// -------------------------------------------------------------------------
33
34// ----- Destructor ----------------------------------------------------
36// -------------------------------------------------------------------------
37
39{
40 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
41 TGeoNode* node = GetNode();
42 TGeoBBox* shape = (TGeoBBox*)node->GetVolume()->GetShape();
43 Double_t origin[3] = {shape->GetOrigin()[0],shape->GetOrigin()[1],shape->GetOrigin()[2]};
44 Double_t master[3] = {0,0,0};
45 nav->LocalToMaster(origin,master);
46 TVector3 pos = TVector3(master[0],master[1],master[2]);
47 return pos;
48}
49Double_t vetoHit::GetX()
50{ TVector3 pos = GetXYZ();
51 return pos.X();
52}
53Double_t vetoHit::GetY()
54{ TVector3 pos = GetXYZ();
55 return pos.Y();
56}
57Double_t vetoHit::GetZ()
58{ TVector3 pos = GetXYZ();
59 return pos.Z();
60}
62{
63 TGeoNode* node;
64 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
65 TString path = "cave/DecayVolume_1/T2_1/VetoLiSc_0/";
66 //id = ShapeType*100000 + blockNr*10000 + Zlayer*100 + number*10 + position;
67 Int_t ShapeType = fDetectorID/100000;
68 Int_t blockNr = (fDetectorID-ShapeType*100000)/10000;
69 Int_t Zlayer = (fDetectorID-ShapeType*100000-blockNr*10000)/100;
70 Int_t number = (fDetectorID-ShapeType*100000-blockNr*10000-Zlayer*100)/10;
71
72 if(ShapeType==1)path+="LiScX_";
73 else if(ShapeType==2)path+="LiScY_";
74 else if(ShapeType==3)path+="LiSc_L1_";
75 else if(ShapeType==4)path+="LiSc_R1_";
76 else if(ShapeType==5)path+="LiSc_L2_";
77 else if(ShapeType==6)path+="LiSc_R2_";
78
79 path+=ShapeType;
80 path+=blockNr;
81 if(ShapeType<3){
82 if(Zlayer<10)path+="0";
83 path+=Zlayer;
84 }
85 else {
86 path+="00";
87 }
88 path+=number;
89 path+="0_";
90 path+=fDetectorID;
91
92 nav->cd(path);
93 node=nav->GetCurrentNode();
94 return node;
95}
96
97
98
99// ----- Public method Print -------------------------------------------
100void vetoHit::Print(Int_t detID) const
101{
102 cout << "-I- vetoHit: veto hit " << " in detector " << fDetectorID << endl;
103 cout << " ADC " << fdigi << " ns" << endl;
104}
105
106// -------------------------------------------------------------------------
107
109
Float_t fdigi
digitized detector hit
Definition ShipHit.h:57
Int_t fDetectorID
Detector unique identifier.
Definition ShipHit.h:58
Float_t flag
flag
Definition vetoHit.h:50
vetoHit()
Definition vetoHit.cxx:19
Double_t GetX()
Definition vetoHit.cxx:49
Double_t GetY()
Definition vetoHit.cxx:53
Double_t GetZ()
Definition vetoHit.cxx:57
Double_t ft
Definition vetoHit.h:46
TGeoNode * GetNode()
Definition vetoHit.cxx:61
virtual ~vetoHit()
Definition vetoHit.cxx:35
TVector3 GetXYZ()
Definition vetoHit.cxx:38
virtual void Print(Int_t detID) const
Definition vetoHit.cxx:100
ClassImp(ecalContFact) ecalContFact
Double_t speedOfLight
Definition vetoHit.cxx:17