CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
cms::ReconstructerFP420 Class Reference

#include <ReconstructerFP420.h>

Inheritance diagram for cms::ReconstructerFP420:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ReconstructerFP420 (const edm::ParameterSet &conf)
 
 ~ReconstructerFP420 () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::vector< std::string > vstring
 

Private Attributes

edm::ParameterSet conf_
 
std::string m_genReadoutName
 
FP420RecoMainsFP420RecoMain_
 
vstring trackerContainers
 
int verbosity
 
int VtxFlag
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 23 of file ReconstructerFP420.h.

Member Typedef Documentation

◆ vstring

typedef std::vector<std::string> cms::ReconstructerFP420::vstring
private

Definition at line 36 of file ReconstructerFP420.h.

Constructor & Destructor Documentation

◆ ReconstructerFP420()

cms::ReconstructerFP420::ReconstructerFP420 ( const edm::ParameterSet conf)
explicit

Definition at line 29 of file ReconstructerFP420.cc.

29  : conf_(conf) {
30  edm::LogInfo("ReconstructerFP420 ") << "Enter the FP420 Reco constructer";
31 
32  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
33  if (verbosity > 0) {
34  std::cout << "Constructor of ReconstructerFP420" << std::endl;
35  }
36 
37  std::string alias(conf.getParameter<std::string>("@module_label"));
38 
39  produces<RecoCollectionFP420>().setBranchAlias(alias);
40 
41  trackerContainers.clear();
42  trackerContainers = conf.getParameter<std::vector<std::string> >("ROUList");
43  VtxFlag = conf.getParameter<int>("VtxFlagGenRec");
44  m_genReadoutName = conf.getParameter<string>("genReadoutName");
45 
46  // Initialization:
48  }

References SiStripOfflineCRack_cfg::alias, conf_, gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_genReadoutName, sFP420RecoMain_, AlCaHLTBitMon_QueryRunRegistry::string, trackerContainers, verbosity, and VtxFlag.

◆ ~ReconstructerFP420()

cms::ReconstructerFP420::~ReconstructerFP420 ( )
override

Definition at line 51 of file ReconstructerFP420.cc.

51  {
52  if (verbosity > 0) {
53  std::cout << "ReconstructerFP420:delete FP420RecoMain" << std::endl;
54  }
55  delete sFP420RecoMain_;
56  }

References gather_cfg::cout, sFP420RecoMain_, and verbosity.

Member Function Documentation

◆ beginJob()

void cms::ReconstructerFP420::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 59 of file ReconstructerFP420.cc.

59  {
60  if (verbosity > 0) {
61  std::cout << "ReconstructerFP420:BeginJob method " << std::endl;
62  }
63  }

References gather_cfg::cout, and verbosity.

◆ produce()

void cms::ReconstructerFP420::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 65 of file ReconstructerFP420.cc.

65  {
66  // beginJob;
67  // be lazy and include the appropriate namespaces
68  using namespace edm;
69  using namespace std;
70 
71  // Get input
72 
73  // Vtx info:
74 
75  // define GEN Vtx of Signal
76  double vtxGenX = 0.;
77  double vtxGenY = 0.;
78  double vtxGenZ = 0.;
79 
80  /*
81  if(VtxFlag == 1) {
82 
83  Handle<HepMCProduct> EvtHandle;
84  try{
85  iEvent.getByLabel(m_genReadoutName,EvtHandle);
86  }catch(const Exception&){
87  if(verbosity>0){
88  std::cout << "no HepMCProduct found"<< std::endl;
89  }
90  }
91 
92  const HepMC::GenEvent* evt = EvtHandle->GetEvent() ;
93  HepMC::GenParticle* proton1 = 0;
94  HepMC::GenParticle* proton2 = 0;
95  double partmomcut=4000.;
96  double pz1max = 0.;
97  double pz2min = 0.;
98  for ( HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p ) {
100  double pz = (*p)->momentum().pz();
101  // if (((*p)->pdg_id() == ipdgproton)&&((*p)->status() == 1)&&(pz > partmomcut)){
102  if( pz > partmomcut){
103  if(pz > pz1max){
104  proton1 = *p;pz1max=pz;
105  }
106  }
107  // else if(( (*p)->pdg_id() == ipdgproton)&&((*p)->status() == 1)&&(pz < -1.*partmomcut)) {
108  else if(pz < -1.*partmomcut) {
109  if(pz < pz2min){
110  proton2 = *p;pz2min=pz;
111  }
112  }
113 
114  }// for
115  if(proton1 && !proton2){
116  vtxGenX = (proton1)->production_vertex()->position().x();
117  vtxGenY = (proton1)->production_vertex()->position().y();
118  vtxGenZ = (proton1)->production_vertex()->position().z();
119  }
120  else if(proton2 && !proton1){
121  vtxGenX = (proton2)->production_vertex()->position().x();
122  vtxGenY = (proton2)->production_vertex()->position().y();
123  vtxGenZ = (proton2)->production_vertex()->position().z();
124  }
125  else if(proton1 && proton2){
126  if(abs((proton1)->momentum().pz()) >= abs((proton2)->momentum().pz()) ) {
127  vtxGenX = (proton1)->production_vertex()->position().x();
128  vtxGenY = (proton1)->production_vertex()->position().y();
129  vtxGenZ = (proton1)->production_vertex()->position().z();
130  }
131  else {
132  vtxGenX = (proton2)->production_vertex()->position().x();
133  vtxGenY = (proton2)->production_vertex()->position().y();
134  vtxGenZ = (proton2)->production_vertex()->position().z();
135  }
136  }
137  }// if(VtxFlag == 1
138 
139 */
140 
141  double VtxX = 0.;
142  double VtxY = 0.;
143  double VtxZ = 0.;
144  if (VtxFlag == 1) {
145  VtxX = vtxGenX; // mm
146  VtxY = vtxGenY; // mm
147  VtxZ = vtxGenZ; // mm
148  }
149 
150  // track collection:
151  //A
152  // edm::Handle<ClusterCollectionFP420> icf_simhit;
153  /*
154  Handle<ClusterCollectionFP420> cf_simhit;
155  std::vector<const ClusterCollectionFP420 *> cf_simhitvec;
156  for(uint32_t i = 0; i< trackerContainers.size();i++){
157  iEvent.getByLabel( trackerContainers[i], cf_simhit);
158  cf_simhitvec.push_back(cf_simhit.product()); }
159  std::unique_ptr<ClusterCollectionFP420 > input(new DigiCollectionFP420(cf_simhitvec));
160  */
161 
162  //B
163 
165  iEvent.getByLabel(trackerContainers[0], input);
166 
167  // Step C: create empty output collection
168  auto toutput = std::make_unique<RecoCollectionFP420>();
169 
170  // put zero to container info from the beginning (important! because not any detID is updated with coming of new event !!!!!!
171  // clean info of container from previous event
172 
173  std::vector<RecoFP420> collector;
174  collector.clear();
176  inputRange.first = collector.begin();
177  inputRange.second = collector.end();
178 
179  unsigned int detID = 0;
180  toutput->putclear(inputRange, detID);
181 
182  unsigned int StID = 1;
183  toutput->putclear(inputRange, StID);
184  StID = 2;
185  toutput->putclear(inputRange, StID);
186 
187  // !!!!!!
188  // if we want to keep Reco container/Collection for one event ---> uncomment the line below and vice versa
189  toutput->clear(); //container_.clear() --> start from the beginning of the container
190 
191  // RUN now: !!!!!!
192  // startFP420RecoMain_.run(input, toutput);
193  sFP420RecoMain_->run(input, toutput.get(), VtxX, VtxY, VtxZ);
194  // std::cout <<"======= ReconstructerFP420: end of produce " << endl;
195 
196  // Step D: write output to file
197  if (verbosity > 0) {
198  std::cout << "ReconstructerFP420: iEvent.put(std::move(toutput)" << std::endl;
199  }
200  iEvent.put(std::move(toutput));
201  if (verbosity > 0) {
202  std::cout << "ReconstructerFP420: iEvent.put(std::move(toutput) DONE" << std::endl;
203  }
204  } //produce

References gather_cfg::cout, iEvent, input, pileupCalc::inputRange, eostools::move(), FP420RecoMain::run(), sFP420RecoMain_, trackerContainers, verbosity, and VtxFlag.

Member Data Documentation

◆ conf_

edm::ParameterSet cms::ReconstructerFP420::conf_
private

Definition at line 37 of file ReconstructerFP420.h.

Referenced by ReconstructerFP420().

◆ m_genReadoutName

std::string cms::ReconstructerFP420::m_genReadoutName
private

Definition at line 43 of file ReconstructerFP420.h.

Referenced by ReconstructerFP420().

◆ sFP420RecoMain_

FP420RecoMain* cms::ReconstructerFP420::sFP420RecoMain_
private

Definition at line 40 of file ReconstructerFP420.h.

Referenced by produce(), ReconstructerFP420(), and ~ReconstructerFP420().

◆ trackerContainers

vstring cms::ReconstructerFP420::trackerContainers
private

Definition at line 38 of file ReconstructerFP420.h.

Referenced by produce(), and ReconstructerFP420().

◆ verbosity

int cms::ReconstructerFP420::verbosity
private

Definition at line 41 of file ReconstructerFP420.h.

Referenced by beginJob(), produce(), ReconstructerFP420(), and ~ReconstructerFP420().

◆ VtxFlag

int cms::ReconstructerFP420::VtxFlag
private

Definition at line 42 of file ReconstructerFP420.h.

Referenced by produce(), and ReconstructerFP420().

cms::ReconstructerFP420::conf_
edm::ParameterSet conf_
Definition: ReconstructerFP420.h:37
input
static const std::string input
Definition: EdmProvDump.cc:48
FP420RecoMain::run
void run(edm::Handle< TrackCollectionFP420 > &input, RecoCollectionFP420 *toutput, double VtxX, double VtxY, double VtxZ)
Runs the algorithm.
Definition: FP420RecoMain.cc:59
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
cms::ReconstructerFP420::VtxFlag
int VtxFlag
Definition: ReconstructerFP420.h:42
edm::Handle
Definition: AssociativeIterator.h:50
pileupCalc.inputRange
inputRange
Definition: pileupCalc.py:218
RecoCollectionFP420::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: RecoCollectionFP420.h:12
FP420RecoMain
Definition: FP420RecoMain.h:22
cms::ReconstructerFP420::sFP420RecoMain_
FP420RecoMain * sFP420RecoMain_
Definition: ReconstructerFP420.h:40
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::ReconstructerFP420::verbosity
int verbosity
Definition: ReconstructerFP420.h:41
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
cms::ReconstructerFP420::trackerContainers
vstring trackerContainers
Definition: ReconstructerFP420.h:38
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:129
cms::ReconstructerFP420::m_genReadoutName
std::string m_genReadoutName
Definition: ReconstructerFP420.h:43