Skip to content

Commit

Permalink
Add a flag to disable strip rechit matching
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Mar 25, 2019
1 parent 2ab4be5 commit ddd42d7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SiStripRecHitConverterAlgorithm
bool isMasked(const SiStripCluster &cluster, bool bad128StripBlocks[6]) const;
bool useModule(const uint32_t id) const;

bool useQuality, maskBad128StripBlocks;
bool useQuality, maskBad128StripBlocks, doMatching;
uint32_t tracker_cache_id, cpe_cache_id, quality_cache_id;
edm::ESInputTag cpeTag, matcherTag, qualityTag;
edm::ESHandle<TrackerGeometry> tracker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ SiStripRecHitConverter::SiStripRecHitConverter(edm::ParameterSet const& conf)
: recHitConverterAlgorithm(conf) ,
matchedRecHitsTag( conf.getParameter<std::string>( "matchedRecHits" ) ),
rphiRecHitsTag( conf.getParameter<std::string>( "rphiRecHits" ) ),
stereoRecHitsTag( conf.getParameter<std::string>( "stereoRecHits" ) )
stereoRecHitsTag( conf.getParameter<std::string>( "stereoRecHits" ) ),
doMatching(conf.getParameter<bool>("doMatching"))
{
clusterProducer = consumes<edmNew::DetSetVector<SiStripCluster> >(conf.getParameter<edm::InputTag>("ClusterProducer"));

produces<SiStripMatchedRecHit2DCollection>( matchedRecHitsTag );
produces<SiStripRecHit2DCollection>( rphiRecHitsTag );
produces<SiStripRecHit2DCollection>( stereoRecHitsTag );
produces<SiStripRecHit2DCollection>( rphiRecHitsTag + "Unmatched" );
produces<SiStripRecHit2DCollection>( stereoRecHitsTag + "Unmatched" );
if(doMatching) {
produces<SiStripMatchedRecHit2DCollection>( matchedRecHitsTag );
produces<SiStripRecHit2DCollection>( rphiRecHitsTag + "Unmatched" );
produces<SiStripRecHit2DCollection>( stereoRecHitsTag + "Unmatched" );
}
}

void SiStripRecHitConverter::
Expand All @@ -30,10 +33,11 @@ produce(edm::Event& e, const edm::EventSetup& es)
<< output.rphi->dataSize() << " clusters in mono detectors\n"
<< output.stereo->dataSize() << " clusters in partners stereo detectors\n";

e.put(std::move(output.matched), matchedRecHitsTag);
e.put(std::move(output.rphi), rphiRecHitsTag );
e.put(std::move(output.stereo), stereoRecHitsTag );
e.put(std::move(output.rphiUnmatched), rphiRecHitsTag + "Unmatched");
e.put(std::move(output.stereoUnmatched), stereoRecHitsTag + "Unmatched");

if(doMatching) {
e.put(std::move(output.matched), matchedRecHitsTag);
e.put(std::move(output.rphiUnmatched), rphiRecHitsTag + "Unmatched");
e.put(std::move(output.stereoUnmatched), stereoRecHitsTag + "Unmatched");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class SiStripRecHitConverter : public edm::stream::EDProducer<>
SiStripRecHitConverterAlgorithm recHitConverterAlgorithm;
std::string matchedRecHitsTag, rphiRecHitsTag, stereoRecHitsTag;
edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > clusterProducer;

bool doMatching;
};
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
rphiRecHits = cms.string('rphiRecHit'),
stereoRecHits = cms.string('stereoRecHit'),
matchedRecHits = cms.string('matchedRecHit'),
VerbosityLevel = cms.untracked.int32(1)
VerbosityLevel = cms.untracked.int32(1),
doMatching = cms.bool(True),
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ TYPELOOKUP_DATA_REG(SiStripRecHitMatcher);
SiStripRecHitConverterAlgorithm::SiStripRecHitConverterAlgorithm(const edm::ParameterSet& conf) :
useQuality(conf.getParameter<bool>("useSiStripQuality")),
maskBad128StripBlocks( conf.existsAs<bool>("MaskBadAPVFibers") && conf.getParameter<bool>("MaskBadAPVFibers")),
doMatching(conf.getParameter<bool>("doMatching")),
tracker_cache_id(0),
cpe_cache_id(0),
quality_cache_id(0),
Expand Down Expand Up @@ -80,7 +81,9 @@ run(edm::Handle<edmNew::DetSetVector<SiStripCluster> > inputhandle, products& ou

if (collector.empty()) collector.abort();
}
match(output,trackdirection);
if(doMatching) {
match(output,trackdirection);
}
}


Expand Down

0 comments on commit ddd42d7

Please sign in to comment.