15 std::vector<std::string> usedTaggers;
16 std::vector<std::string> usedModules;
17 std::vector<std::string> usedStrips;
24 for(
auto const& auxDet : auxDets){
27 std::set<std::string> volNames = {auxDet.TotalVolume()->GetName()};
31 std::string
path =
"";
32 for (
size_t inode = 0; inode < paths.at(0).size(); inode++){
33 path += paths.at(0).at(inode)->GetName();
34 if(inode < paths.at(0).size() - 1){
41 for(
size_t i = 0; i < auxDet.NSensitiveVolume(); i++){
47 manager->cd(path.c_str());
53 TGeoNode* nodeArray = manager->GetCurrentNode();
54 TGeoNode* nodeStrip = nodeArray->GetDaughter(i);
55 TGeoNode* nodeModule = manager->GetMother(1);
56 TGeoNode* nodeTagger = manager->GetMother(2);
57 TGeoNode* nodeDet = manager->GetMother(3);
60 std::string taggerName = nodeTagger->GetName();
61 if(std::find(usedTaggers.begin(), usedTaggers.end(), taggerName) == usedTaggers.end()){
62 usedTaggers.push_back(taggerName);
65 double halfWidth = ((TGeoBBox*)nodeTagger->GetVolume()->GetShape())->GetDX();
66 double halfHeight = ((TGeoBBox*)nodeTagger->GetVolume()->GetShape())->GetDY();
67 double halfLength = ((TGeoBBox*)nodeTagger->GetVolume()->GetShape())->GetDZ()/2;
70 double limits[3] = {halfWidth, halfHeight, halfLength};
72 nodeTagger->LocalToMaster(limits, limitsDet);
73 double limitsWorld[3];
74 nodeDet->LocalToMaster(limitsDet, limitsWorld);
76 double limits2[3] = {-halfWidth, -halfHeight, -halfLength};
78 nodeTagger->LocalToMaster(limits2, limitsDet2);
79 double limitsWorld2[3];
80 nodeDet->LocalToMaster(limitsDet2, limitsWorld2);
84 tagger.name = taggerName;
85 tagger.minX = std::min(limitsWorld[0], limitsWorld2[0]);
86 tagger.maxX = std::max(limitsWorld[0], limitsWorld2[0]);
87 tagger.minY = std::min(limitsWorld[1], limitsWorld2[1]);
88 tagger.maxY = std::max(limitsWorld[1], limitsWorld2[1]);
89 tagger.minZ = std::min(limitsWorld[2], limitsWorld2[2]);
90 tagger.maxZ = std::max(limitsWorld[2], limitsWorld2[2]);
96 std::string moduleName = nodeModule->GetName();
97 if(std::find(usedModules.begin(), usedModules.end(), moduleName) == usedModules.end()){
98 usedModules.push_back(moduleName);
102 double halfWidth = auxDet.HalfWidth1();
103 double halfHeight = auxDet.HalfHeight();
104 double halfLength = auxDet.Length()/2;
107 double limits[3] = {halfWidth, halfHeight, halfLength};
108 double limitsWorld[3];
109 auxDet.LocalToWorld(limits, limitsWorld);
111 double limits2[3] = {-halfWidth, -halfHeight, -halfLength};
112 double limitsWorld2[3];
113 auxDet.LocalToWorld(limits2, limitsWorld2);
116 double origin[3] = {0, 0, 0};
117 double modulePosMother[3];
118 nodeModule->LocalToMaster(origin, modulePosMother);
119 size_t planeID = (modulePosMother[2] > 0);
121 bool top = (planeID == 1) ? (modulePosMother[1] > 0) : (modulePosMother[0] < 0);
125 module.name = moduleName;
126 module.auxDetID = ad_i;
127 module.minX = std::min(limitsWorld[0], limitsWorld2[0]);
128 module.maxX = std::max(limitsWorld[0], limitsWorld2[0]);
129 module.minY = std::min(limitsWorld[1], limitsWorld2[1]);
130 module.maxY = std::max(limitsWorld[1], limitsWorld2[1]);
131 module.minZ = std::min(limitsWorld[2], limitsWorld2[2]);
132 module.maxZ = std::max(limitsWorld[2], limitsWorld2[2]);
133 module.normal = auxDet.GetNormalVector();
135 module.planeID = planeID;
137 module.tagger = taggerName;
142 std::string stripName = nodeStrip->GetName();
143 if(std::find(usedStrips.begin(), usedStrips.end(), stripName) == usedStrips.end()){
144 usedStrips.push_back(stripName);
151 double halfWidth = auxDetSensitive.
HalfWidth1();
152 double halfHeight = auxDetSensitive.
HalfHeight();
153 double halfLength = auxDetSensitive.
Length()/2;
156 double limits[3] = {halfWidth, halfHeight, halfLength};
157 double limitsWorld[3];
160 double limits2[3] = {-halfWidth, -halfHeight, -halfLength};
161 double limitsWorld2[3];
165 CRTStripGeo
strip = {};
166 strip.name = stripName;
167 strip.sensitiveVolumeID = sv_i;
168 strip.minX = std::min(limitsWorld[0], limitsWorld2[0]);
169 strip.maxX = std::max(limitsWorld[0], limitsWorld2[0]);
170 strip.minY = std::min(limitsWorld[1], limitsWorld2[1]);
171 strip.maxY = std::max(limitsWorld[1], limitsWorld2[1]);
172 strip.minZ = std::min(limitsWorld[2], limitsWorld2[2]);
173 strip.maxZ = std::max(limitsWorld[2], limitsWorld2[2]);
175 strip.width = halfHeight * 2.;
177 strip.module = moduleName;
180 uint32_t channel0 = 32 * ad_i + 2 * sv_i + 0;
181 uint32_t channel1 = 32 * ad_i + 2 * sv_i + 1;
183 double sipm0Y = -halfHeight;
184 double sipm1Y = halfHeight;
187 double sipmX = halfWidth;
188 if(!
fModules[moduleName].top) sipmX = - halfWidth;
189 double sipm0XYZ[3] = {sipmX, sipm0Y, 0};
190 double sipm0XYZWorld[3];
193 CRTSipmGeo sipm0 = {};
194 sipm0.channel = channel0;
195 sipm0.x = sipm0XYZWorld[0];
196 sipm0.y = sipm0XYZWorld[1];
197 sipm0.z = sipm0XYZWorld[2];
198 sipm0.strip = stripName;
202 double sipm1XYZ[3] = {sipmX, sipm1Y, 0};
203 double sipm1XYZWorld[3];
206 CRTSipmGeo sipm1 = {};
207 sipm1.channel = channel1;
208 sipm1.x = sipm1XYZWorld[0];
209 sipm1.y = sipm1XYZWorld[1];
210 sipm1.z = sipm1XYZWorld[2];
211 sipm1.strip = stripName;
215 strip.sipms = std::make_pair(channel0, channel1);
229 std::string taggerName = module.second.tagger;
230 std::string moduleName = module.second.name;
231 fTaggers[taggerName].modules[moduleName] = module.second;
const geo::AuxDetGeometryCore * fAuxDetGeoCore
finds tracks best matching by with limits
const geo::GeometryCore * geometry
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
geo::GeometryCore const * fGeometryService
std::map< std::string, CRTModuleGeo > fModules
double HalfWidth1() const
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
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
std::map< std::string, CRTTaggerGeo > fTaggers
std::map< int, CRTSipmGeo > fSipms
std::vector< AuxDetGeo > const & AuxDetGeoVec() const
Returns the full list of pointer to the auxiliary detectors.
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.
std::map< std::string, CRTStripGeo > fStrips
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.