@@ -149,8 +149,8 @@ void CTPPSPixelLocalTrackProducer::fillDescriptions(edm::ConfigurationDescriptio
149149 desc.add <double >(" roadRadius" , 1.0 )->setComment (" radius of pattern search window" );
150150 desc.add <int >(" minRoadSize" , 3 )->setComment (" minimum number of points in a pattern" );
151151 desc.add <int >(" maxRoadSize" , 20 )->setComment (" maximum number of points in a pattern" );
152- // parameter for bad pot reconstruction patch 45-220-fr 2022
153- desc.add <double >(" roadRadiusBadPot" , 0.5 )->setComment (" radius of pattern search window for bad Pot " );
152+ // parameter for 2-plane- pot reconstruction patch in run 3
153+ desc.add <double >(" roadRadiusBadPot" , 0.5 )->setComment (" radius of pattern search window for 2 plane pot " );
154154
155155 descriptions.add (" ctppsPixelLocalTracks" , desc);
156156}
@@ -170,30 +170,62 @@ void CTPPSPixelLocalTrackProducer::produce(edm::Event &iEvent, const edm::EventS
170170 geometryWatcher_.check (iSetup);
171171
172172 // get mask
173- bool isBadPot_45_220 = false ;
173+
174+ // 2 planes pot flag vector 0=45-220, 1=45-210, 2=56-210, 3=56-220
175+ bool is2PlanePotV[4 ] = {false };
176+
174177 if (!recHits->empty ()) {
175178 const auto &mask = iSetup.getData (tokenCTPPSPixelAnalysisMask_);
176179
177- // Read Mask checking if 45-220-far is masked as bad and needs special treatment
180+ // Read Mask checking if 4 planes are masked and pot needs special treatment
178181 std::map<uint32_t , CTPPSPixelROCAnalysisMask> const &maschera = mask.analysisMask ;
179182
180- bool mask_45_220[6 ][6 ] = {{false }};
183+ // vector of masked rocs
184+ bool maskV[4 ][6 ][6 ] = {{{false }}};
185+
181186 for (auto const &det : maschera) {
182187 CTPPSPixelDetId detId (det.first );
183188 unsigned int rocNum = (det.first & rocMask) >> rocOffset;
184189 if (rocNum > 5 || detId.plane () > 5 )
185190 throw cms::Exception (" InvalidRocOrPlaneNumber" ) << " roc number from mask: " << rocNum;
186191
187- if (detId.arm () == 0 && detId.station () == 2 && detId.rp () == 3 ) { // pot 45-220-far
188- if (det.second .maskedPixels .size () == rocSizeInPixels) { // roc fully masked
189- mask_45_220[detId.plane ()][rocNum] = true ;
192+ if (detId.arm () == 0 && detId.rp () == 3 ) {
193+ if (detId.station () == 2 ) { // pot 45-220-far
194+ if (det.second .maskedPixels .size () == rocSizeInPixels || det.second .fullMask == true ) { // roc fully masked
195+ maskV[0 ][detId.plane ()][rocNum] = true ;
196+ }
197+ } else if (detId.station () == 0 ) { // pot 45-210-far
198+ if (det.second .maskedPixels .size () == rocSizeInPixels || det.second .fullMask == true ) { // roc fully masked
199+ maskV[1 ][detId.plane ()][rocNum] = true ;
200+ }
201+ }
202+ } else if (detId.arm () == 1 && detId.rp () == 3 ) {
203+ if (detId.station () == 0 ) { // pot 56-210-far
204+ if (det.second .maskedPixels .size () == rocSizeInPixels || det.second .fullMask == true ) { // roc fully masked
205+ maskV[2 ][detId.plane ()][rocNum] = true ;
206+ }
207+ } else if (detId.station () == 2 ) { // pot 56-220-far
208+ if (det.second .maskedPixels .size () == rocSizeInPixels || det.second .fullMask == true ) { // roc fully masked
209+ maskV[3 ][detId.plane ()][rocNum] = true ;
210+ }
190211 }
191212 }
192213 }
214+ // search for specific pattern that requires special reconstruction (use of two plane tracks)
193215
194- // search for specific pattern that requires special reconstruction (isBadPot)
195- isBadPot_45_220 = mask_45_220[1 ][4 ] && mask_45_220[1 ][5 ] && mask_45_220[2 ][4 ] && mask_45_220[2 ][5 ] &&
196- mask_45_220[3 ][4 ] && mask_45_220[3 ][5 ] && mask_45_220[4 ][4 ] && mask_45_220[4 ][5 ];
216+ for (unsigned int i = 0 ; i < 4 ; i++) {
217+ unsigned int numberOfMaskedPlanes = 0 ;
218+ for (unsigned int j = 0 ; j < 6 ; j++) {
219+ if (maskV[i][j][0 ] && maskV[i][j][1 ] && maskV[i][j][4 ] && maskV[i][j][5 ])
220+ numberOfMaskedPlanes++;
221+ }
222+ if (numberOfMaskedPlanes == 4 )
223+ is2PlanePotV[i] = true ; // search for exactly 4 planes fully masked
224+ edm::LogInfo (" CTPPSPixelLocalTrackProducer" ) << " Masked planes in Pot #" << i << " = " << numberOfMaskedPlanes;
225+ if (is2PlanePotV[i])
226+ edm::LogInfo (" CTPPSPixelLocalTrackProducer" )
227+ << " Enabling 2 plane track reconstruction for pot #" << i << " (0=45-220, 1=45-210, 2=56-210, 3=56-220) " ;
228+ }
197229 }
198230 std::vector<CTPPSPixelDetId> listOfPotWithHighOccupancyPlanes;
199231 std::map<CTPPSPixelDetId, uint32_t > mapHitPerPot;
@@ -215,7 +247,7 @@ void CTPPSPixelLocalTrackProducer::produce(edm::Event &iEvent, const edm::EventS
215247 if (maxHitPerPlane_ >= 0 && hitOnPlane > (uint32_t )maxHitPerPlane_) {
216248 if (verbosity_ > 2 )
217249 edm::LogInfo (" CTPPSPixelLocalTrackProducer" )
218- << " ---> To many hits in the plane, pot will be excluded from tracking cleared" ;
250+ << " ---> Too many hits in the plane, pot will be excluded from tracking cleared" ;
219251 listOfPotWithHighOccupancyPlanes.push_back (tmpRomanPotId);
220252 }
221253 }
@@ -240,7 +272,7 @@ void CTPPSPixelLocalTrackProducer::produce(edm::Event &iEvent, const edm::EventS
240272 patternFinder_->clear ();
241273 patternFinder_->setHits (&recHitVector);
242274 patternFinder_->setGeometry (&geometry);
243- patternFinder_->findPattern (isBadPot_45_220 );
275+ patternFinder_->findPattern (is2PlanePotV );
244276 std::vector<RPixDetPatternFinder::Road> patternVector = patternFinder_->getPatterns ();
245277
246278 // loop on all the patterns
0 commit comments