Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
g4hitshift.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file g4hitshift.cc
1 #include <g4main/PHG4Hit.h>
3 
4 #include "g4hitshift.h"
5 
7 
9 
10 #include <phool/PHCompositeNode.h>
11 
12 // G4Hits includes
13 #include <g4main/PHG4Hit.h>
16 #include <g4main/PHG4Particle.h>
17 #include <g4main/PHG4HitDefs.h> // for hit_idbits
18 
19 // G4Cells includes
20 #include <g4detectors/PHG4Cell.h>
22 #include <g4detectors/PHG4CellDefs.h> // for genkey, keytype
23 
24 // Tower includes
25 #include <calobase/RawTower.h>
26 #include <calobase/RawTowerContainer.h>
27 #include <calobase/RawTowerGeom.h>
28 #include <calobase/RawTowerGeomContainer.h>
29 #include <calobase/RawTowerDefs.h>
30 // Cluster includes
31 #include <calobase/RawCluster.h>
32 #include <calobase/RawClusterContainer.h>
33 
36 
37 
39 #include "g4detectors/PHG4CylinderGeom_Spacalv1.h" // for PHG4CylinderGeom_Spaca...
43 
44 
45 #include <phool/getClass.h>
46 #include <TProfile.h>
47 #include <TFile.h>
48 #include <TNtuple.h>
49 #include <TMath.h>
50 #include <cassert>
51 #include <sstream>
52 #include <string>
53 #include <TF1.h>
54 
55 
56 //____________________________________________________________________________..
58  SubsysReco(name)
59 {
60 }
61 
62 //____________________________________________________________________________..
64 {
65 }
66 
67 //____________________________________________________________________________..
69 {
71 }
72 
73 //____________________________________________________________________________..
75 {
77 }
78 
79 //____________________________________________________________________________..
81 {
82  PHG4HitContainer* hits = findNode::getClass<PHG4HitContainer>(topNode, "G4HIT_CEMC");
83  if (hits)
84  {
85  //-----------------------------------------------------------------------
86  //Loop over G4Hits
87  //-----------------------------------------------------------------------
88  PHG4HitContainer::ConstRange hit_range = hits->getHits();
89  for (PHG4HitContainer::ConstIterator hit_iter = hit_range.first; hit_iter != hit_range.second; hit_iter++)
90  {
91  int scint_id = hit_iter->second->get_scint_id();
92 
94 
95  int sectornumber = decoder.sector_ID;
96  int shiftedsector = sectornumber + 8;
97  if (shiftedsector > 31)
98  {
99  shiftedsector = shiftedsector - 31;
100  }
101  PHG4CylinderGeom_Spacalv3::scint_id_coder encoder(shiftedsector,decoder.tower_ID,decoder.fiber_ID);
102 
103  hit_iter->second->set_scint_id(encoder.scint_ID);
104  }
105  }
107 }
108 
109 //____________________________________________________________________________..
111 {
113 }
114 
115 //____________________________________________________________________________..
117 {
119 }
120 
121 //____________________________________________________________________________..
123 {
125 }
126 
127 //____________________________________________________________________________..
129 {
131 }
132 
133 //____________________________________________________________________________..
134 void g4hitshift::Print(const std::string &what) const
135 {
136 }