CMS 3D CMS Logo

EcalTBHodoscopeRecInfoProducer.cc
Go to the documentation of this file.
8 
10 
12  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
13  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
14  recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection");
15  fitMethod_ = ps.getParameter<int>("fitMethod");
16 
17  // std::vector<double> planeShift_def;
18  // planeShift_def.push_back( -0.333 );
19  // planeShift_def.push_back( -0.333 );
20  // planeShift_def.push_back( -0.333 );
21  // planeShift_def.push_back( -0.333 );
22  std::vector<double> planeShift = ps.getParameter<std::vector<double> >("planeShift");
23 
24  // std::vector<double> zPosition_def;
25  // zPosition_def.push_back( -0.333 );
26  // zPosition_def.push_back( -0.333 );
27  // zPosition_def.push_back( -0.333 );
28  // zPosition_def.push_back( -0.333 );
29  std::vector<double> zPosition = ps.getParameter<std::vector<double> >("zPosition");
30 
31  produces<EcalTBHodoscopeRecInfo>(recInfoCollection_);
32 
34 }
35 
37 
39  // Get input
40  edm::Handle<EcalTBHodoscopeRawInfo> ecalRawHodoscope;
41  const EcalTBHodoscopeRawInfo* ecalHodoRawInfo = nullptr;
42  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
43  e.getByLabel(rawInfoProducer_, ecalRawHodoscope);
44  if (ecalRawHodoscope.isValid()) {
45  ecalHodoRawInfo = ecalRawHodoscope.product();
46  }
47 
48  if (!ecalHodoRawInfo) {
49  edm::LogError("EcalTBHodoscopeRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str();
50  return;
51  }
52 
53  if ((*ecalHodoRawInfo).planes() != 4) {
54  edm::LogError("EcalTBHodoscopeRecInfoError")
55  << "Number of planes different from expected " << rawInfoCollection_.c_str();
56  return;
57  }
58 
59  // Create empty output
60 
61  e.put(std::make_unique<EcalTBHodoscopeRecInfo>(algo_->reconstruct(*ecalRawHodoscope)), recInfoCollection_);
62 }
EcalTBHodoscopeRecInfoProducer::rawInfoCollection_
std::string rawInfoCollection_
Definition: EcalTBHodoscopeRecInfoProducer.h:23
Handle.h
MessageLogger.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ESHandle.h
EcalTBHodoscopeRawInfo.h
EcalTBHodoscopeRecInfoAlgo
Definition: EcalTBHodoscopeRecInfoAlgo.h:11
EcalTBHodoscopeRecInfoProducer.h
EcalTBHodoscopeRecInfoProducer::rawInfoProducer_
std::string rawInfoProducer_
Definition: EcalTBHodoscopeRecInfoProducer.h:22
EcalTBHodoscopeRecInfoProducer::fitMethod_
int fitMethod_
Definition: EcalTBHodoscopeRecInfoProducer.h:26
ecal2004TBHodoscopeReconstructor_cfi.planeShift
planeShift
Definition: ecal2004TBHodoscopeReconstructor_cfi.py:8
edm::Handle
Definition: AssociativeIterator.h:50
ecal2004TBHodoscopeReconstructor_cfi.zPosition
zPosition
Definition: ecal2004TBHodoscopeReconstructor_cfi.py:9
EcalTBHodoscopeRecInfoProducer::produce
void produce(edm::Event &e, const edm::EventSetup &es) override
Definition: EcalTBHodoscopeRecInfoProducer.cc:38
EcalTBHodoscopeRecInfoProducer::EcalTBHodoscopeRecInfoProducer
EcalTBHodoscopeRecInfoProducer(const edm::ParameterSet &ps)
Definition: EcalTBHodoscopeRecInfoProducer.cc:11
edm::ParameterSet
Definition: ParameterSet.h:47
EcalTBHodoscopeRecInfo.h
EcalTBHodoscopeRawInfo
Definition: EcalTBHodoscopeRawInfo.h:13
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EcalTBHodoscopeRecInfoAlgo::reconstruct
EcalTBHodoscopeRecInfo reconstruct(const EcalTBHodoscopeRawInfo &hodoscopeRawInfo) const
Definition: EcalTBHodoscopeRecInfoAlgo.cc:97
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTBHodoscopeRecInfoProducer::algo_
EcalTBHodoscopeRecInfoAlgo * algo_
Definition: EcalTBHodoscopeRecInfoProducer.h:27
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalTBHodoscopeRecInfoProducer::~EcalTBHodoscopeRecInfoProducer
~EcalTBHodoscopeRecInfoProducer() override
Definition: EcalTBHodoscopeRecInfoProducer.cc:36
EcalTBHodoscopeRecInfoProducer::recInfoCollection_
std::string recInfoCollection_
Definition: EcalTBHodoscopeRecInfoProducer.h:24
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
EDCollection.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37