55
66#include " FWCore/MessageLogger/interface/MessageLogger.h"
77#include " FWCore/ParameterSet/interface/ParameterSet.h"
8+ #include " FWCore/ParameterSet/interface/ParameterSetDescription.h"
9+ #include " FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
810#include " FWCore/Utilities/interface/InputTag.h"
911#include " FWCore/Utilities/interface/ESGetToken.h"
1012
4850
4951#include < boost/regex.hpp>
5052#include < map>
53+ #include < optional>
5154// #include <math>
5255
5356/* *
@@ -84,6 +87,8 @@ namespace reco {
8487 std::vector<TrackingRecHit *> &hits);
8588 void produceFromTrack (const edm::EventSetup &iSetup, const Track *itt, std::vector<TrackingRecHit *> &hits);
8689
90+ static void fillDescriptions (edm::ConfigurationDescriptions &descriptions);
91+
8792 private:
8893 class Rule {
8994 public:
@@ -124,6 +129,7 @@ namespace reco {
124129 bool stripBackInvalidHits_;
125130 bool stripAllInvalidHits_;
126131
132+ bool isPhase2_;
127133 bool rejectBadStoNHits_;
128134 std::string CMNSubtractionMode_;
129135 std::vector<bool > subdetStoN_; // (6); //,std::bool(false));
@@ -156,7 +162,7 @@ namespace reco {
156162 edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tokenMagField;
157163 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tokenTrackerTopo;
158164
159- SiStripClusterInfo siStripClusterInfo_;
165+ std::optional< SiStripClusterInfo> siStripClusterInfo_;
160166
161167 bool tagOverlaps_;
162168 int nOverlaps;
@@ -298,6 +304,7 @@ namespace reco {
298304 stripFrontInvalidHits_(iConfig.getParameter<bool >(" stripFrontInvalidHits" )),
299305 stripBackInvalidHits_(iConfig.getParameter<bool >(" stripBackInvalidHits" )),
300306 stripAllInvalidHits_(iConfig.getParameter<bool >(" stripAllInvalidHits" )),
307+ isPhase2_(iConfig.getParameter<bool >(" isPhase2" )),
301308 rejectBadStoNHits_(iConfig.getParameter<bool >(" rejectBadStoNHits" )),
302309 CMNSubtractionMode_(iConfig.getParameter<std::string>(" CMNSubtractionMode" )),
303310 detsToIgnore_(iConfig.getParameter<std::vector<uint32_t > >(" detsToIgnore" )),
@@ -309,8 +316,13 @@ namespace reco {
309316 pxlTPLProbXYQ_(iConfig.getParameter<double >(" PxlTemplateProbXYChargeCut" )),
310317 pxlTPLqBin_(iConfig.getParameter<std::vector<int32_t > >(" PxlTemplateqBinCut" )),
311318 PXLcorrClusChargeCut_(iConfig.getParameter<double >(" PxlCorrClusterChargeCut" )),
312- siStripClusterInfo_(consumesCollector()),
313319 tagOverlaps_(iConfig.getParameter<bool >(" tagOverlaps" )) {
320+ // construct the SiStripClusterInfo object only for Phase-0 / Phase-1
321+ // no Strip modules in Phase-2
322+ if (!isPhase2_) {
323+ siStripClusterInfo_ = consumesCollector ();
324+ }
325+
314326 tokenGeometry = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
315327 tokenMagField = esConsumes<MagneticField, IdealMagneticFieldRecord>();
316328 tokenTrackerTopo = esConsumes<TrackerTopology, TrackerTopologyRcd>();
@@ -399,7 +411,8 @@ namespace reco {
399411 // read from EventSetup
400412 theGeometry = iSetup.getHandle (tokenGeometry);
401413 theMagField = iSetup.getHandle (tokenMagField);
402- siStripClusterInfo_.initEvent (iSetup);
414+ if (!isPhase2_)
415+ siStripClusterInfo_->initEvent (iSetup);
403416
404417 // prepare output collection
405418 size_t candcollsize;
@@ -781,6 +794,12 @@ namespace reco {
781794
782795 // if( subdetStoN_[subdet_cnt-1]&& (id.subdetId()==subdet_cnt) ){//check that hit is in a det belonging to a subdet where we decided to apply a S/N cut
783796
797+ // for phase-2 OT placehold, do nothing
798+ if (GeomDetEnumerators::isOuterTracker (theGeometry->geomDetSubDetector (id.subdetId ())) &&
799+ !GeomDetEnumerators::isTrackerStrip (theGeometry->geomDetSubDetector (id.subdetId ()))) {
800+ return true ;
801+ }
802+
784803 if (GeomDetEnumerators::isTrackerStrip (theGeometry->geomDetSubDetector (id.subdetId ()))) {
785804 if (subdetStoN_[subdet_cnt - 1 ]) {
786805 // check that hit is in a det belonging to a subdet where we decided to apply a S/N cut
@@ -816,14 +835,14 @@ namespace reco {
816835 }
817836
818837 if (keepthishit) {
819- siStripClusterInfo_. setCluster (*cluster, id.rawId ());
838+ siStripClusterInfo_-> setCluster (*cluster, id.rawId ());
820839 if ((subdetStoNlowcut_[subdet_cnt - 1 ] > 0 ) &&
821- (siStripClusterInfo_. signalOverNoise () < subdetStoNlowcut_[subdet_cnt - 1 ]))
840+ (siStripClusterInfo_-> signalOverNoise () < subdetStoNlowcut_[subdet_cnt - 1 ]))
822841 keepthishit = false ;
823842 if ((subdetStoNhighcut_[subdet_cnt - 1 ] > 0 ) &&
824- (siStripClusterInfo_. signalOverNoise () > subdetStoNhighcut_[subdet_cnt - 1 ]))
843+ (siStripClusterInfo_-> signalOverNoise () > subdetStoNhighcut_[subdet_cnt - 1 ]))
825844 keepthishit = false ;
826- // if(!keepthishit)std::cout<<"Hit rejected because of bad S/N: "<<siStripClusterInfo_. signalOverNoise()<<std::endl;
845+ // if(!keepthishit)std::cout<<"Hit rejected because of bad S/N: "<<siStripClusterInfo_-> signalOverNoise()<<std::endl;
827846 }
828847
829848 } // end if subdetStoN_[subdet_cnt]&&...
@@ -975,6 +994,39 @@ namespace reco {
975994 return tTopo->side (id);
976995 }
977996
997+ // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
998+ void TrackerTrackHitFilter::fillDescriptions (edm::ConfigurationDescriptions &descriptions) {
999+ edm::ParameterSetDescription desc;
1000+ desc.setComment (" " );
1001+ desc.add <edm::InputTag>(" src" , edm::InputTag (" generalTracks" ));
1002+ desc.add <uint32_t >(" minimumHits" , 3 )->setComment (" number of hits for refit" );
1003+ desc.add <bool >(" replaceWithInactiveHits" , false )
1004+ ->setComment (
1005+ " instead of removing hits replace them with inactive hits, so you still consider the multiple "
1006+ " scattering" );
1007+ desc.add <bool >(" stripFrontInvalidHits" , false )
1008+ ->setComment (" strip invalid & inactive hits from any end of the track" );
1009+ desc.add <bool >(" stripBackInvalidHits" , false )
1010+ ->setComment (" strip invalid & inactive hits from any end of the track" );
1011+ desc.add <bool >(" stripAllInvalidHits" , false )->setComment (" dangerous to turn on, you might forget about MS" );
1012+ desc.add <bool >(" isPhase2" , false );
1013+ desc.add <bool >(" rejectBadStoNHits" , false );
1014+ desc.add <std::string>(" CMNSubtractionMode" , std::string (" Median" ))->setComment (" TT6" );
1015+ desc.add <std::vector<uint32_t > >(" detsToIgnore" , {});
1016+ desc.add <bool >(" useTrajectories" , false );
1017+ desc.add <bool >(" rejectLowAngleHits" , false );
1018+ desc.add <double >(" TrackAngleCut" , 0.25 )->setComment (" rad" );
1019+ desc.add <bool >(" usePixelQualityFlag" , false );
1020+ desc.add <double >(" PxlTemplateProbXYCut" , 0.000125 );
1021+ desc.add <double >(" PxlTemplateProbXYChargeCut" , -99 .);
1022+ desc.add <std::vector<int32_t > >(" PxlTemplateqBinCut" , {0 , 3 });
1023+ desc.add <double >(" PxlCorrClusterChargeCut" , -999.0 );
1024+ desc.add <bool >(" tagOverlaps" , false );
1025+ desc.add <std::vector<std::string> >(" commands" , {})->setComment (" layers to remove" );
1026+ desc.add <std::vector<std::string> >(" StoNcommands" , {})->setComment (" S/N cut per layer" );
1027+ descriptions.addWithDefaultLabel (desc);
1028+ }
1029+
9781030 } // namespace modules
9791031} // namespace reco
9801032
0 commit comments