@@ -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 ;
@@ -65,9 +66,10 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
6566 float lengthOuterTof = 680 .f ;
6667 std::pair<float , float > radiusRangeDiskTof = {15 .f , 100 .f };
6768 float zForwardTof = 370 .f ;
69+ LOG (info) << " Configuring IOTOF layers with '" << pattern << " ' pattern" ;
6870 if (pattern == " " ) {
71+ LOG (info) << " Default pattern" ;
6972 } else if (pattern == " v3b" ) {
70- LOG (info) << " Configuring IOTOF layers with v3b pattern" ;
7173 ftof = false ;
7274 btof = false ;
7375 } else if (pattern == " v3b1a" ) {
@@ -93,17 +95,25 @@ void Detector::configLayers(bool itof, bool otof, bool ftof, bool btof, std::str
9395 } else {
9496 LOG (fatal) << " IOTOF layer pattern " << pattern << " not recognized, exiting" ;
9597 }
96- if (itof) {
97- mITOFLayer = ITOFLayer (std::string{GeometryTGeo::getITOFLayerPattern ()}, radiusInnerTof, 0 .f , lengthInnerTof, 0 .f , 0 .02f , true ); // iTOF
98+ if (itof) { // iTOF
99+ mITOFLayer = itofSegmented ? ITOFLayer (std::string{GeometryTGeo::getITOFLayerPattern ()},
100+ radiusInnerTof, 0 .f , lengthInnerTof, 0 .f , 0 .02f , ITOFLayer::kBarrelSegmented ,
101+ 24 , 5.42 , 80 , 10 )
102+ : ITOFLayer (std::string{GeometryTGeo::getITOFLayerPattern ()},
103+ radiusInnerTof, 0 .f , lengthInnerTof, 0 .f , 0 .02f , ITOFLayer::kBarrel );
98104 }
99- if (otof) {
100- mOTOFLayer = OTOFLayer (std::string{GeometryTGeo::getOTOFLayerPattern ()}, radiusOuterTof, 0 .f , lengthOuterTof, 0 .f , 0 .02f , true ); // oTOF
105+ if (otof) { // oTOF
106+ mOTOFLayer = otofSegmented ? OTOFLayer (std::string{GeometryTGeo::getOTOFLayerPattern ()},
107+ radiusOuterTof, 0 .f , lengthOuterTof, 0 .f , 0 .02f , OTOFLayer::kBarrelSegmented ,
108+ 62 , 9.74 , 432 , 5 )
109+ : OTOFLayer (std::string{GeometryTGeo::getOTOFLayerPattern ()},
110+ radiusOuterTof, 0 .f , lengthOuterTof, 0 .f , 0 .02f , OTOFLayer::kBarrel );
101111 }
102112 if (ftof) {
103- mFTOFLayer = FTOFLayer (std::string{GeometryTGeo::getFTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , zForwardTof, 0 .02f , false ); // fTOF
113+ mFTOFLayer = FTOFLayer (std::string{GeometryTGeo::getFTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , zForwardTof, 0 .02f , FTOFLayer:: kDisk ); // fTOF
104114 }
105115 if (btof) {
106- mBTOFLayer = BTOFLayer (std::string{GeometryTGeo::getBTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , -zForwardTof, 0 .02f , false ); // bTOF
116+ mBTOFLayer = BTOFLayer (std::string{GeometryTGeo::getBTOFLayerPattern ()}, radiusRangeDiskTof.first , radiusRangeDiskTof.second , 0 .f , -zForwardTof, 0 .02f , BTOFLayer:: kDisk ); // bTOF
107117 }
108118}
109119
@@ -186,14 +196,18 @@ void Detector::defineSensitiveVolumes()
186196 // The names of the IOTOF sensitive volumes have the format: IOTOFLayer(0...mLayers.size()-1)
187197 auto & iotofPars = IOTOFBaseParam::Instance ();
188198 if (iotofPars.enableInnerTOF ) {
189- v = geoManager->GetVolume (GeometryTGeo::getITOFSensorPattern ());
190- LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
191- AddSensitiveVolume (v);
199+ for (const std::string& itofSensor : ITOFLayer::mRegister ) {
200+ v = geoManager->GetVolume (itofSensor.c_str ());
201+ LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
202+ AddSensitiveVolume (v);
203+ }
192204 }
193205 if (iotofPars.enableOuterTOF ) {
194- v = geoManager->GetVolume (GeometryTGeo::getOTOFSensorPattern ());
195- LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
196- AddSensitiveVolume (v);
206+ for (const std::string& otofSensor : OTOFLayer::mRegister ) {
207+ v = geoManager->GetVolume (otofSensor.c_str ());
208+ LOGP (info, " Adding IOTOF Sensitive Volume {}" , v->GetName ());
209+ AddSensitiveVolume (v);
210+ }
197211 }
198212 if (iotofPars.enableForwardTOF ) {
199213 v = geoManager->GetVolume (GeometryTGeo::getFTOFSensorPattern ());
0 commit comments