CMS 3D CMS Logo

VectorHitBuilderEDProducer.cc
Go to the documentation of this file.
6 
12 
15 
17 public:
19  ~VectorHitBuilderEDProducer() override = default;
20  void produce(edm::Event&, const edm::EventSetup&) override;
24  VectorHitCollection& outputAcc,
25  VectorHitCollection& outputRej);
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
27  const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }
28 
29 private:
32  unsigned int maxOfflinestubs_;
35 };
36 
38  : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")),
39  maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")),
40  stubsBuilderToken_(esConsumes(conf.getParameter<edm::ESInputTag>("Algorithm"))) {
42  consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters")));
43 
44  produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("accepted");
45  produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("rejected");
46  produces<VectorHitCollection>("accepted");
47  produces<VectorHitCollection>("rejected");
48 }
49 
51  LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin";
52 
53  // get input clusters data
54  auto clustersHandle = event.getHandle(clusterProducer_);
55  // create the final output collection
56  auto outputClustersAccepted = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D>>();
57  auto outputClustersRejected = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D>>();
58  std::unique_ptr<VectorHitCollection> outputVHAccepted(new VectorHitCollection());
59  std::unique_ptr<VectorHitCollection> outputVHRejected(new VectorHitCollection());
60 
62 #ifdef EDM_ML_DEBUG
63  // check on the input clusters
64  stubsBuilder_->printClusters(*clustersHandle);
65 #endif //EDM_ML_DEBUG
66 
67  // running the stub building algorithm
68  //ERICA::output should be moved in the different algo classes?
69  run(clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected);
70 #ifdef EDM_ML_DEBUG
71  unsigned int numberOfVectorHits = 0;
72  for (const auto& dSViter : *outputVHAccepted) {
73  for (const auto& vh : dSViter) {
74  numberOfVectorHits++;
75  LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << vh;
76  }
77  }
78  LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n";
79 #endif //EDM_ML_DEBUG
80  // write output to file
81  event.put(std::move(outputClustersAccepted), "accepted");
82  event.put(std::move(outputClustersRejected), "rejected");
83  event.put(std::move(outputVHAccepted), "accepted");
84  event.put(std::move(outputVHRejected), "rejected");
85 }
86 
90  VectorHitCollection& outputAcc,
91  VectorHitCollection& outputRej) {
92  stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej);
93 }
96  desc.add<std::string>("offlinestubs", "vectorHits");
97  desc.add<int>("maxVectorHits", 999999999);
98  desc.add<edm::ESInputTag>("Algorithm", edm::ESInputTag("", "SiPhase2VectorHitMatcher"));
99  desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"));
100  desc.add<std::vector<double>>("BarrelCut",
101  {
102  0.0,
103  0.05,
104  0.06,
105  0.08,
106  0.09,
107  0.12,
108  0.2,
109  });
110  desc.add<std::string>("Clusters", "siPhase2Clusters");
111  desc.add<int>("maxVectorHitsInAStack", 999);
112  desc.add<std::vector<double>>("EndcapCut",
113  {
114  0.0,
115  0.1,
116  0.1,
117  0.1,
118  0.1,
119  0.1,
120  });
121  descriptions.add("siPhase2VectorHits", desc);
122 }
ConfigurationDescriptions.h
edm::ESInputTag
Definition: ESInputTag.h:87
VectorHitBuilderEDProducer::stubsBuilderToken_
edm::ESGetToken< VectorHitBuilderAlgorithm, TkPhase2OTCPERecord > stubsBuilderToken_
Definition: VectorHitBuilderEDProducer.cc:33
MessageLogger.h
VectorHitBuilderEDProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: VectorHitBuilderEDProducer.cc:50
ESInputTag
VectorHitCollection
edmNew::DetSetVector< VectorHit > VectorHitCollection
Definition: VectorHit.h:151
VectorHitBuilderAlgorithm.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
TkPhase2OTCPERecord.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
typelookup.h
EDProducer.h
VectorHitBuilderEDProducer::run
void run(edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >> clusters, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersAcc, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersRej, VectorHitCollection &outputAcc, VectorHitCollection &outputRej)
Definition: VectorHitBuilderEDProducer.cc:87
edm::Handle
Definition: AssociativeIterator.h:50
VectorHitBuilderEDProducer::clusterProducer_
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > clusterProducer_
Definition: VectorHitBuilderEDProducer.cc:34
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ParameterSetDescription.h
VectorHitBuilderAlgorithm
Definition: VectorHitBuilderAlgorithm.h:17
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
VectorHitBuilderEDProducer::maxOfflinestubs_
unsigned int maxOfflinestubs_
Definition: VectorHitBuilderEDProducer.cc:32
VectorHitBuilderEDProducer::stubsBuilder_
const VectorHitBuilderAlgorithm * stubsBuilder_
Definition: VectorHitBuilderEDProducer.cc:30
createfilelist.int
int
Definition: createfilelist.py:10
VectorHitBuilderEDProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: VectorHitBuilderEDProducer.cc:94
edm::stream::EDProducer
Definition: EDProducer.h:38
VectorHitBuilderEDProducer
Definition: VectorHitBuilderEDProducer.cc:16
edm::EventSetup
Definition: EventSetup.h:57
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
edm::ESGetToken< VectorHitBuilderAlgorithm, TkPhase2OTCPERecord >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
VectorHitBuilderEDProducer::offlinestubsTag_
std::string offlinestubsTag_
Definition: VectorHitBuilderEDProducer.cc:31
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
Phase2TrackerCluster1D.h
VectorHitBuilderAlgorithmBase::printClusters
void printClusters(const edmNew::DetSetVector< Phase2TrackerCluster1D > &clusters) const
Definition: VectorHitBuilderAlgorithmBase.cc:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
VectorHitBuilderAlgorithm::run
void run(edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >> clusters, VectorHitCollection &vhAcc, VectorHitCollection &vhRej, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersAcc, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersRej) const override
Definition: VectorHitBuilderAlgorithm.cc:7
VectorHitBuilderEDProducer::algo
const VectorHitBuilderAlgorithm * algo() const
Definition: VectorHitBuilderEDProducer.cc:27
ParameterSet.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
VectorHitBuilderEDProducer::VectorHitBuilderEDProducer
VectorHitBuilderEDProducer(const edm::ParameterSet &)
Definition: VectorHitBuilderEDProducer.cc:37
VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer
~VectorHitBuilderEDProducer() override=default
VectorHitBuilderAlgorithmBase.h
VectorHit.h