@@ -40,7 +40,8 @@ Detector::Detector(bool active)
4040 auto & iotofPars = IOTOFBaseParam::Instance ();
4141 configLayers (iotofPars.enableInnerTOF , iotofPars.enableOuterTOF ,
4242 iotofPars.enableForwardTOF , iotofPars.enableBackwardTOF ,
43- iotofPars.detectorPattern );
43+ iotofPars.detectorPattern ,
44+ iotofPars.segmentedInnerTOF , iotofPars.segmentedOuterTOF );
4445}
4546
4647Detector::~Detector ()
@@ -56,7 +57,7 @@ void Detector::ConstructGeometry()
5657 createGeometry ();
5758}
5859
59- void Detector::configLayers (bool itof, bool otof, bool ftof, bool btof, std::string pattern)
60+ void Detector::configLayers (bool itof, bool otof, bool ftof, bool btof, std::string pattern, bool itofSegmented, bool otofSegmented )
6061{
6162
6263 float radiusInnerTof = 19 .f ;
@@ -94,16 +95,22 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
9495 LOG (fatal) << " IOTOF layer pattern " << pattern << " not recognized, exiting" ;
9596 }
9697 if (itof) {
97- mITOFLayer = ITOFLayer (std::string{GeometryTGeo::getITOFLayerPattern ()}, radiusInnerTof, 0 .f , lengthInnerTof, 0 .f , 0 .02f , true ); // iTOF
98+ if (itofSegmented)
99+ mITOFLayer = ITOFLayer (std::string{GeometryTGeo::getITOFLayerPattern ()}, radiusInnerTof, 0 .f , lengthInnerTof, 0 .f , 0 .02f , ITOFLayer::kBarrelSegmented , 236 ); // iTOF
100+ else
101+ mITOFLayer = ITOFLayer (std::string{GeometryTGeo::getITOFLayerPattern ()}, radiusInnerTof, 0 .f , lengthInnerTof, 0 .f , 0 .02f , ITOFLayer::kBarrel ); // iTOF
98102 }
99103 if (otof) {
100- mOTOFLayer = OTOFLayer (std::string{GeometryTGeo::getOTOFLayerPattern ()}, radiusOuterTof, 0 .f , lengthOuterTof, 0 .f , 0 .02f , true ); // oTOF
104+ if (otofSegmented)
105+ mOTOFLayer = OTOFLayer (std::string{GeometryTGeo::getOTOFLayerPattern ()}, radiusOuterTof, 0 .f , lengthOuterTof, 0 .f , 0 .02f , OTOFLayer::kBarrelSegmented , 124 ); // oTOF
106+ else
107+ mOTOFLayer = OTOFLayer (std::string{GeometryTGeo::getOTOFLayerPattern ()}, radiusOuterTof, 0 .f , lengthOuterTof, 0 .f , 0 .02f , OTOFLayer::kBarrel ); // oTOF
101108 }
102109 if (ftof) {
103- mFTOFLayer = FTOFLayer (std::string{GeometryTGeo::getFTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , zForwardTof, 0 .02f , false ); // fTOF
110+ mFTOFLayer = FTOFLayer (std::string{GeometryTGeo::getFTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , zForwardTof, 0 .02f , FTOFLayer:: kDisk ); // fTOF
104111 }
105112 if (btof) {
106- mBTOFLayer = BTOFLayer (std::string{GeometryTGeo::getBTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , -zForwardTof, 0 .02f , false ); // bTOF
113+ mBTOFLayer = BTOFLayer (std::string{GeometryTGeo::getBTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , -zForwardTof, 0 .02f , BTOFLayer:: kDisk ); // bTOF
107114 }
108115}
109116
@@ -186,14 +193,18 @@ void Detector::defineSensitiveVolumes()
186193 // The names of the IOTOF sensitive volumes have the format: IOTOFLayer(0...mLayers.size()-1)
187194 auto & iotofPars = IOTOFBaseParam::Instance ();
188195 if (iotofPars.enableInnerTOF ) {
189- v = geoManager->GetVolume (GeometryTGeo::getITOFSensorPattern ());
190- LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
191- AddSensitiveVolume (v);
196+ for (const std::string& itofSensor : ITOFLayer::mRegister ) {
197+ v = geoManager->GetVolume (itofSensor.c_str ());
198+ LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
199+ AddSensitiveVolume (v);
200+ }
192201 }
193202 if (iotofPars.enableOuterTOF ) {
194- v = geoManager->GetVolume (GeometryTGeo::getOTOFSensorPattern ());
195- LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
196- AddSensitiveVolume (v);
203+ for (const std::string& otofSensor : OTOFLayer::mRegister ) {
204+ v = geoManager->GetVolume (otofSensor.c_str ());
205+ LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
206+ AddSensitiveVolume (v);
207+ }
197208 }
198209 if (iotofPars.enableForwardTOF ) {
199210 v = geoManager->GetVolume (GeometryTGeo::getFTOFSensorPattern ());
0 commit comments