CMS 3D CMS Logo

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

#include <ClusterizerFP420.h>

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

Public Member Functions

void beginJob () override
 
 ClusterizerFP420 (const edm::ParameterSet &conf)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~ClusterizerFP420 () 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
 
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)
 
 ~ProducerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

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

Private Attributes

edm::ParameterSet conf_
 
int dn0
 
std::vector< ClusterNoiseFP420noise
 
int pn0
 
int rn0
 
FP420ClusterMainsClusterizerFP420_
 
int sn0
 
ClusterCollectionFP420soutput
 
vstring trackerContainers
 
bool UseNoiseBadElectrodeFlagFromDB_
 
int verbosity
 

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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 33 of file ClusterizerFP420.h.

Member Typedef Documentation

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

Definition at line 49 of file ClusterizerFP420.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file ClusterizerFP420.cc.

References met_cff::alias, conf_, gather_cfg::cout, dn0, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), pn0, rn0, sClusterizerFP420_, sn0, AlCaHLTBitMon_QueryRunRegistry::string, trackerContainers, and verbosity.

44  :
45  conf_(conf) {
46 
47 
48  std::string alias ( conf.getParameter<std::string>("@module_label") );
49 
50  produces<ClusterCollectionFP420>().setBranchAlias( alias );
51 
52  trackerContainers.clear();
53  trackerContainers = conf.getParameter<std::vector<std::string> >("ROUList");
54 
55  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
56  dn0 = conf_.getParameter<int>("NumberFP420Detectors");
57  sn0 = conf_.getParameter<int>("NumberFP420Stations");
58  pn0 = conf_.getParameter<int>("NumberFP420SPlanes");
59  rn0 = 7;
60  if (verbosity > 0) {
61  std::cout << "Creating a ClusterizerFP420" << std::endl;
62  std::cout << "ClusterizerFP420: dn0=" << dn0 << " sn0=" << sn0 << " pn0=" << pn0 << " rn0=" << rn0 << std::endl;
63  }
64 
65  sClusterizerFP420_ = new FP420ClusterMain(conf_,dn0,sn0,pn0,rn0);
66  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet conf_
FP420ClusterMain * sClusterizerFP420_
cms::ClusterizerFP420::~ClusterizerFP420 ( )
override

Definition at line 69 of file ClusterizerFP420.cc.

References sClusterizerFP420_.

69  {
70  delete sClusterizerFP420_;
71  }
FP420ClusterMain * sClusterizerFP420_

Member Function Documentation

void cms::ClusterizerFP420::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 74 of file ClusterizerFP420.cc.

References gather_cfg::cout, and verbosity.

74  {
75  if (verbosity > 0) {
76  std::cout << "BeginJob method " << std::endl;
77  }
78  //Getting Calibration data (Noises and BadElectrodes Flag)
79  // bool UseNoiseBadElectrodeFlagFromDB_=conf_.getParameter<bool>("UseNoiseBadElectrodeFlagFromDB");
80  // if (UseNoiseBadElectrodeFlagFromDB_==true){
81  // iSetup.get<ClusterNoiseFP420Rcd>().get(noise);// AZ: do corrections for noise here
82  //=========================================================
83  //
84  // Debug: show noise for DetIDs
85  // ElectrodNoiseMapIterator mapit = noise->m_noises.begin();
86  // for (;mapit!=noise->m_noises.end();mapit++)
87  // {
88  // unsigned int detid = (*mapit).first;
89  // std::cout << "detid " << detid << " # Electrode " << (*mapit).second.size()<<std::endl;
90  // //ElectrodNoiseVector theElectrodVector = (*mapit).second;
91  // const ElectrodNoiseVector theElectrodVector = noise->getElectrodNoiseVector(detid);
92 
93 
94  // int electrode=0;
95  // ElectrodNoiseVectorIterator iter=theElectrodVector.begin();
96  // //for(; iter!=theElectrodVector.end(); iter++)
97  // {
98  // std::cout << " electrode " << electrode++ << " =\t"
99  // << iter->getNoise() << " \t"
100  // << iter->getDisable() << " \t"
101  // << std::endl;
102  // }
103  // }
104  //===========================================================
105  // }
106  }
void cms::ClusterizerFP420::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 108 of file ClusterizerFP420.cc.

References ClusterCollectionFP420::clear(), gather_cfg::cout, dn0, Exception, ClusterCollectionFP420::get(), edm::Event::getByLabel(), input, estimatePileup::inputRange, eostools::move(), noise, FP420NumberingScheme::packMYIndex(), pn0, edm::Event::put(), ClusterCollectionFP420::putclear(), rn0, FP420ClusterMain::run(), sClusterizerFP420_, sn0, soutput, trackerContainers, verbosity, and ecaldqm::zside().

109  {
110  // beginJob;
111  // be lazy and include the appropriate namespaces
112  using namespace edm;
113  using namespace std;
114  if (verbosity > 0) {
115  std::cout << "ClusterizerFP420: produce" << std::endl;
116  }
117 
118  // Get input
119  //A
120  // edm::Handle<DigiCollectionFP420> icf_simhit;
121  /*
122  Handle<DigiCollectionFP420> cf_simhit;
123  std::vector<const DigiCollectionFP420 *> cf_simhitvec;
124  for(uint32_t i = 0; i< trackerContainers.size();i++){
125  iEvent.getByLabel( trackerContainers[i], cf_simhit);
126  cf_simhitvec.push_back(cf_simhit.product()); }
127  std::auto_ptr<DigiCollectionFP420 > digis(new DigiCollectionFP420(cf_simhitvec));
128 
129  std::vector<HDigiFP420> input;
130  DigiCollectionFP420::iterator isim;
131  for (isim=digis->begin(); isim!= digis->end();isim++) {
132  input.push_back(*isim);
133  }
134 */
135  //B
136 
138  try{
139  // iEvent.getByLabel( "FP420Digi" , digis);
140  iEvent.getByLabel( trackerContainers[0] , input);
141  } catch(const Exception&)
142  {
143  // in principal, should never happen, as it's taken care of by Framework
144  throw cms::Exception("InvalidReference")
145  << "Invalid reference to DigiCollectionFP420 \n";
146  }
147 
148  if (verbosity > 0) {
149  std::cout << "ClusterizerFP420: OK1" << std::endl;
150  }
151 
152  // Step C: create empty output collection
153  auto soutput = std::make_unique<ClusterCollectionFP420>();
155  /*
156  std::vector<SimVertex> input;
157  Handle<DigiCollectionFP420> digis;
158  iEvent.getByLabel("FP420Digi",digis);
159  input.insert(input.end(),digis->begin(),digis->end());
160 
161 
162 
163  std::vector<HDigiFP420> input;
164  for(std::vector<HDigiFP420>::const_iterator vsim=digis->begin();
165  vsim!=digis->end(); ++vsim){
166  input.push_back(*vsim);
167  }
168  theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
169 */
170  // std::vector<HDigiFP420> input;
171  // DigiCollectionFP420 input;
172  //input.push_back(digis);
173  // input.insert(input.end(), digis->begin(), digis->end());
174 
175  /*
176  std::vector<HDigiFP420> input;
177  input.clear();
178  DigiCollectionFP420::ContainerIterator sort_begin = digis->begin();
179  DigiCollectionFP420::ContainerIterator sort_end = digis->end();
180  for ( ;sort_begin != sort_end; ++sort_begin ) {
181  input.push_back(*sort_begin);
182  } // for
183 */
184 
185 
186  // put zero to container info from the beginning (important! because not any detID is updated with coming of new event !!!!!!
187  // clean info of container from previous event
188  for (int det=1; det<dn0; det++) {
189  for (int sector=1; sector<sn0; sector++) {
190  for (int zmodule=1; zmodule<pn0; zmodule++) {
191  for (int zside=1; zside<rn0; zside++) {
192  // intindex is a continues numbering of FP420
193  unsigned int detID = FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
194  std::vector<ClusterFP420> collector;
195  collector.clear();
197  inputRange.first = collector.begin();
198  inputRange.second = collector.end();
199 
200  soutput->putclear(inputRange,detID);
201 
202  }//for
203  }//for
204  }//for
205  }//for
206 
207 
208  // !!!!!!
209  // if we want to keep Cluster container/Collection for one event ---> uncomment the line below and vice versa
210  soutput->clear(); //container_.clear() --> start from the beginning of the container
211 
212  // RUN now: !!!!!!
213  // sClusterizerFP420_.run(input, soutput, noise);
214  if (verbosity > 0) {
215  std::cout << "ClusterizerFP420: OK2" << std::endl;
216  }
217  sClusterizerFP420_->run(input, soutput.get(), noise);
218 
219  if (verbosity > 0) {
220  std::cout << "ClusterizerFP420: OK3" << std::endl;
221  }
222 
223  // if(collectorZS.data.size()>0){
224 
225  // std::cout <<"======= ClusterizerFP420: end of produce " << std::endl;
226 
227  // Step D: write output to file
228  iEvent.put(std::move(soutput));
229  if (verbosity > 0) {
230  std::cout << "ClusterizerFP420: OK4" << std::endl;
231  }
232  }//produce
void run(edm::Handle< DigiCollectionFP420 > &input, ClusterCollectionFP420 *soutput, std::vector< ClusterNoiseFP420 > &noise)
Runs the algorithm.
int zside(DetId const &)
static std::string const input
Definition: EdmProvDump.cc:44
int iEvent
Definition: GenABIO.cc:230
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
ClusterCollectionFP420 * soutput
const Range get(unsigned int detID) const
FP420ClusterMain * sClusterizerFP420_
HLT enums.
inputRange
Get input source.
void putclear(Range input, unsigned int detID)
std::pair< ContainerIterator, ContainerIterator > Range
def move(src, dest)
Definition: eostools.py:510
std::vector< ClusterNoiseFP420 > noise

Member Data Documentation

edm::ParameterSet cms::ClusterizerFP420::conf_
private

Definition at line 54 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420().

int cms::ClusterizerFP420::dn0
private

Definition at line 63 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

std::vector<ClusterNoiseFP420> cms::ClusterizerFP420::noise
private

Definition at line 61 of file ClusterizerFP420.h.

Referenced by produce().

int cms::ClusterizerFP420::pn0
private

Definition at line 63 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

int cms::ClusterizerFP420::rn0
private

Definition at line 63 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

FP420ClusterMain* cms::ClusterizerFP420::sClusterizerFP420_
private

Definition at line 57 of file ClusterizerFP420.h.

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

int cms::ClusterizerFP420::sn0
private

Definition at line 63 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

ClusterCollectionFP420* cms::ClusterizerFP420::soutput
private

Definition at line 59 of file ClusterizerFP420.h.

Referenced by produce().

vstring cms::ClusterizerFP420::trackerContainers
private

Definition at line 55 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

bool cms::ClusterizerFP420::UseNoiseBadElectrodeFlagFromDB_
private

Definition at line 62 of file ClusterizerFP420.h.

int cms::ClusterizerFP420::verbosity
private

Definition at line 64 of file ClusterizerFP420.h.

Referenced by beginJob(), ClusterizerFP420(), and produce().