CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
VectorHitBuilderEDProducer Class Reference
Inheritance diagram for VectorHitBuilderEDProducer:
edm::stream::EDProducer<>

Public Member Functions

const VectorHitBuilderAlgorithmalgo () const
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void run (edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >> clusters, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersAcc, edmNew::DetSetVector< Phase2TrackerCluster1D > &clustersRej, VectorHitCollection &outputAcc, VectorHitCollection &outputRej)
 
 VectorHitBuilderEDProducer (const edm::ParameterSet &)
 
 ~VectorHitBuilderEDProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > clusterProducer_
 
unsigned int maxOfflinestubs_
 
std::string offlinestubsTag_
 
const VectorHitBuilderAlgorithmstubsBuilder_
 
edm::ESGetToken< VectorHitBuilderAlgorithm, TkPhase2OTCPERecordstubsBuilderToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 16 of file VectorHitBuilderEDProducer.cc.

Constructor & Destructor Documentation

◆ VectorHitBuilderEDProducer()

VectorHitBuilderEDProducer::VectorHitBuilderEDProducer ( const edm::ParameterSet conf)
explicit

Definition at line 37 of file VectorHitBuilderEDProducer.cc.

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 }

References clusterProducer_, edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~VectorHitBuilderEDProducer()

VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer ( )
overridedefault

Member Function Documentation

◆ algo()

const VectorHitBuilderAlgorithm* VectorHitBuilderEDProducer::algo ( ) const
inline

Definition at line 27 of file VectorHitBuilderEDProducer.cc.

27 { return stubsBuilder_; }

References stubsBuilder_.

◆ fillDescriptions()

void VectorHitBuilderEDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 94 of file VectorHitBuilderEDProducer.cc.

94  {
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 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

void VectorHitBuilderEDProducer::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 50 of file VectorHitBuilderEDProducer.cc.

50  {
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 }

References clusterProducer_, edm::EventSetup::getData(), LogDebug, eostools::move(), VectorHitBuilderAlgorithmBase::printClusters(), run(), stubsBuilder_, and stubsBuilderToken_.

◆ run()

void VectorHitBuilderEDProducer::run ( edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D >>  clusters,
edmNew::DetSetVector< Phase2TrackerCluster1D > &  clustersAcc,
edmNew::DetSetVector< Phase2TrackerCluster1D > &  clustersRej,
VectorHitCollection outputAcc,
VectorHitCollection outputRej 
)

Definition at line 87 of file VectorHitBuilderEDProducer.cc.

91  {
92  stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej);
93 }

References bsc_activity_cfg::clusters, VectorHitBuilderAlgorithm::run(), and stubsBuilder_.

Referenced by produce().

Member Data Documentation

◆ clusterProducer_

edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > VectorHitBuilderEDProducer::clusterProducer_
private

Definition at line 34 of file VectorHitBuilderEDProducer.cc.

Referenced by produce(), and VectorHitBuilderEDProducer().

◆ maxOfflinestubs_

unsigned int VectorHitBuilderEDProducer::maxOfflinestubs_
private

Definition at line 32 of file VectorHitBuilderEDProducer.cc.

◆ offlinestubsTag_

std::string VectorHitBuilderEDProducer::offlinestubsTag_
private

Definition at line 31 of file VectorHitBuilderEDProducer.cc.

◆ stubsBuilder_

const VectorHitBuilderAlgorithm* VectorHitBuilderEDProducer::stubsBuilder_
private

Definition at line 30 of file VectorHitBuilderEDProducer.cc.

Referenced by algo(), produce(), and run().

◆ stubsBuilderToken_

edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> VectorHitBuilderEDProducer::stubsBuilderToken_
private

Definition at line 33 of file VectorHitBuilderEDProducer.cc.

Referenced by produce().

edm::ESInputTag
Definition: ESInputTag.h:87
VectorHitBuilderEDProducer::stubsBuilderToken_
edm::ESGetToken< VectorHitBuilderAlgorithm, TkPhase2OTCPERecord > stubsBuilderToken_
Definition: VectorHitBuilderEDProducer.cc:33
VectorHitCollection
edmNew::DetSetVector< VectorHit > VectorHitCollection
Definition: VectorHit.h:151
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
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
VectorHitBuilderEDProducer::clusterProducer_
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > clusterProducer_
Definition: VectorHitBuilderEDProducer.cc:34
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
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
VectorHitBuilderEDProducer::maxOfflinestubs_
unsigned int maxOfflinestubs_
Definition: VectorHitBuilderEDProducer.cc:32
VectorHitBuilderEDProducer::stubsBuilder_
const VectorHitBuilderAlgorithm * stubsBuilder_
Definition: VectorHitBuilderEDProducer.cc:30
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
VectorHitBuilderEDProducer::offlinestubsTag_
std::string offlinestubsTag_
Definition: VectorHitBuilderEDProducer.cc:31
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
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