15 std::vector<std::string> usedTaggers;
16 std::vector<std::string> usedModules;
17 std::vector<std::string> usedStrips;
24 for(
auto const& auxDet : auxDets){
28 for(
size_t i = 0; i < auxDet.NSensitiveVolume(); i++){
32 std::set<std::string> volNames = {auxDetSensitive.
TotalVolume()->GetName()};
36 std::string
path =
"";
37 for (
size_t inode = 0; inode < paths.at(0).size(); inode++){
38 path += paths.at(0).at(inode)->GetName();
39 if(inode < paths.at(0).size() - 1){
46 manager->cd(path.c_str());
49 TGeoNode* nodeStrip = manager->GetCurrentNode();
50 TGeoNode* nodeModule = manager->GetMother(2);
51 TGeoNode* nodeTagger = manager->GetMother(3);
52 TGeoNode* nodeDet = manager->GetMother(4);
55 std::string taggerName = nodeTagger->GetName();
56 if(std::find(usedTaggers.begin(), usedTaggers.end(), taggerName) == usedTaggers.end()){
57 usedTaggers.push_back(taggerName);
60 double halfWidth = ((TGeoBBox*)nodeTagger->GetVolume()->GetShape())->GetDX();
61 double halfHeight = ((TGeoBBox*)nodeTagger->GetVolume()->GetShape())->GetDY();
62 double halfLength = ((TGeoBBox*)nodeTagger->GetVolume()->GetShape())->GetDZ()/2;
65 double limits[3] = {halfWidth, halfHeight, halfLength};
67 nodeTagger->LocalToMaster(limits, limitsDet);
68 double limitsWorld[3];
69 nodeDet->LocalToMaster(limitsDet, limitsWorld);
71 double limits2[3] = {-halfWidth, -halfHeight, -halfLength};
73 nodeTagger->LocalToMaster(limits2, limitsDet2);
74 double limitsWorld2[3];
75 nodeDet->LocalToMaster(limitsDet2, limitsWorld2);
79 tagger.name = taggerName;
80 tagger.minX = std::min(limitsWorld[0], limitsWorld2[0]);
81 tagger.maxX = std::max(limitsWorld[0], limitsWorld2[0]);
82 tagger.minY = std::min(limitsWorld[1], limitsWorld2[1]);
83 tagger.maxY = std::max(limitsWorld[1], limitsWorld2[1]);
84 tagger.minZ = std::min(limitsWorld[2], limitsWorld2[2]);
85 tagger.maxZ = std::max(limitsWorld[2], limitsWorld2[2]);
91 std::string moduleName = nodeModule->GetName();
92 if(std::find(usedModules.begin(), usedModules.end(), moduleName) == usedModules.end()){
93 usedModules.push_back(moduleName);
97 double halfWidth = auxDet.HalfWidth1();
98 double halfHeight = auxDet.HalfHeight();
99 double halfLength = auxDet.Length()/2;
102 double limits[3] = {halfWidth, halfHeight, halfLength};
103 double limitsWorld[3];
104 auxDet.LocalToWorld(limits, limitsWorld);
106 double limits2[3] = {-halfWidth, -halfHeight, -halfLength};
107 double limitsWorld2[3];
108 auxDet.LocalToWorld(limits2, limitsWorld2);
111 double origin[3] = {0, 0, 0};
112 double modulePosMother[3];
113 nodeModule->LocalToMaster(origin, modulePosMother);
114 size_t planeID = (modulePosMother[2] > 0);
116 bool top = (planeID == 1) ? (modulePosMother[1] > 0) : (modulePosMother[0] < 0);
120 module.name = moduleName;
121 module.auxDetID = ad_i;
122 module.minX = std::min(limitsWorld[0], limitsWorld2[0]);
123 module.maxX = std::max(limitsWorld[0], limitsWorld2[0]);
124 module.minY = std::min(limitsWorld[1], limitsWorld2[1]);
125 module.maxY = std::max(limitsWorld[1], limitsWorld2[1]);
126 module.minZ = std::min(limitsWorld[2], limitsWorld2[2]);
127 module.maxZ = std::max(limitsWorld[2], limitsWorld2[2]);
128 module.normal = auxDet.GetNormalVector();
130 module.planeID = planeID;
132 module.tagger = taggerName;
137 std::string stripName = nodeStrip->GetName();
138 if(std::find(usedStrips.begin(), usedStrips.end(), stripName) == usedStrips.end()){
139 usedStrips.push_back(stripName);
142 double halfWidth = auxDetSensitive.
HalfWidth1();
143 double halfHeight = auxDetSensitive.
HalfHeight();
144 double halfLength = auxDetSensitive.
Length()/2;
147 double limits[3] = {halfWidth, halfHeight, halfLength};
148 double limitsWorld[3];
151 double limits2[3] = {-halfWidth, -halfHeight, -halfLength};
152 double limitsWorld2[3];
156 CRTStripGeo
strip = {};
157 strip.name = stripName;
158 strip.sensitiveVolumeID = sv_i;
159 strip.minX = std::min(limitsWorld[0], limitsWorld2[0]);
160 strip.maxX = std::max(limitsWorld[0], limitsWorld2[0]);
161 strip.minY = std::min(limitsWorld[1], limitsWorld2[1]);
162 strip.maxY = std::max(limitsWorld[1], limitsWorld2[1]);
163 strip.minZ = std::min(limitsWorld[2], limitsWorld2[2]);
164 strip.maxZ = std::max(limitsWorld[2], limitsWorld2[2]);
166 strip.width = halfWidth * 2.;
168 strip.module = moduleName;
171 uint32_t channel0 = 32 * ad_i + 2 * sv_i + 0;
172 uint32_t channel1 = 32 * ad_i + 2 * sv_i + 1;
174 double sipm0X = -halfWidth;
175 double sipm1X = halfWidth;
177 double sipmY = halfHeight;
178 if(!
fModules[moduleName].top) sipmY = - halfHeight;
179 double sipm0XYZ[3] = {sipm0X, sipmY, 0};
180 double sipm0XYZWorld[3];
183 CRTSipmGeo sipm0 = {};
184 sipm0.channel = channel0;
185 sipm0.x = sipm0XYZWorld[0];
186 sipm0.y = sipm0XYZWorld[1];
187 sipm0.z = sipm0XYZWorld[2];
188 sipm0.strip = stripName;
192 double sipm1XYZ[3] = {sipm1X, sipmY, 0};
193 double sipm1XYZWorld[3];
196 CRTSipmGeo sipm1 = {};
197 sipm1.channel = channel1;
198 sipm1.x = sipm1XYZWorld[0];
199 sipm1.y = sipm1XYZWorld[1];
200 sipm1.z = sipm1XYZWorld[2];
201 sipm1.strip = stripName;
205 strip.sipms = std::make_pair(channel0, channel1);
219 std::string taggerName = module.second.tagger;
220 std::string moduleName = module.second.name;
221 fTaggers[taggerName].modules[moduleName] = module.second;
std::map< std::string, CRTModuleGeo > fModules
finds tracks best matching by with limits
const geo::GeometryCore * geometry
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
std::map< std::string, CRTTaggerGeo > fTaggers
double HalfWidth1() const
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
std::map< std::string, CRTStripGeo > fStrips
std::map< int, CRTSipmGeo > fSipms
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
double HalfHeight() const
const TGeoVolume * TotalVolume() const
geo::GeometryCore const * fGeometryService
std::vector< AuxDetGeo > const & AuxDetGeoVec() const
Returns the full list of pointer to the auxiliary detectors.
const geo::AuxDetGeometryCore * fAuxDetGeoCore
std::vector< std::vector< TGeoNode const * > > FindAllVolumePaths(std::set< std::string > const &vol_names) const
Returns paths of all nodes with volumes with the specified names.
void LocalToWorld(const double *auxdet, double *world) const
Transform point from local auxiliary detector frame to world frame.
constexpr Point origin()
Returns a origin position with a point of the specified type.