CMS 3D CMS Logo

HGCalUncalibRecHitProducer.cc
Go to the documentation of this file.
2 
5 
7 
9 
11 
13  : eeDigiCollection_(consumes<HGCalDigiCollection>(ps.getParameter<edm::InputTag>("HGCEEdigiCollection"))),
14  hefDigiCollection_(consumes<HGCalDigiCollection>(ps.getParameter<edm::InputTag>("HGCHEFdigiCollection"))),
15  hebDigiCollection_(consumes<HGCalDigiCollection>(ps.getParameter<edm::InputTag>("HGCHEBdigiCollection"))),
16  hfnoseDigiCollection_(consumes<HGCalDigiCollection>(ps.getParameter<edm::InputTag>("HGCHFNosedigiCollection"))),
17  ee_geometry_token_(esConsumes(edm::ESInputTag("", "HGCalEESensitive"))),
18  hef_geometry_token_(esConsumes(edm::ESInputTag("", "HGCalHESiliconSensitive"))),
19  heb_geometry_token_(esConsumes(edm::ESInputTag("", "HGCalHEScintillatorSensitive"))),
20  hfnose_geometry_token_(esConsumes(edm::ESInputTag("", "HGCalHFNoseSensitive"))),
21  eeHitCollection_(ps.getParameter<std::string>("HGCEEhitCollection")),
22  hefHitCollection_(ps.getParameter<std::string>("HGCHEFhitCollection")),
23  hebHitCollection_(ps.getParameter<std::string>("HGCHEBhitCollection")),
24  hfnoseHitCollection_(ps.getParameter<std::string>("HGCHFNosehitCollection")),
25  worker_{HGCalUncalibRecHitWorkerFactory::get()->create(
26  ps.getParameter<std::string>("algo"), ps, consumesCollector(), ps.getParameter<bool>("computeLocalTime"))} {
27  produces<HGCeeUncalibratedRecHitCollection>(eeHitCollection_);
28  produces<HGChefUncalibratedRecHitCollection>(hefHitCollection_);
29  produces<HGChebUncalibratedRecHitCollection>(hebHitCollection_);
30  produces<HGChfnoseUncalibratedRecHitCollection>(hfnoseHitCollection_);
31 }
32 
34 
36  using namespace edm;
37 
38  // prepare output
39  auto eeUncalibRechits = std::make_unique<HGCeeUncalibratedRecHitCollection>();
40  auto hefUncalibRechits = std::make_unique<HGChefUncalibratedRecHitCollection>();
41  auto hebUncalibRechits = std::make_unique<HGChebUncalibratedRecHitCollection>();
42  auto hfnoseUncalibRechits = std::make_unique<HGChfnoseUncalibratedRecHitCollection>();
43 
44  // loop over HGCEE digis
45  const auto& pHGCEEDigis = evt.getHandle(eeDigiCollection_);
46  if (pHGCEEDigis.isValid()) {
47  worker_->runHGCEE(es.getHandle(ee_geometry_token_), *pHGCEEDigis, *eeUncalibRechits);
48  evt.put(std::move(eeUncalibRechits), eeHitCollection_);
49  }
50  // loop over HGCHEsil digis
51  const auto& pHGCHEFDigis = evt.getHandle(hefDigiCollection_);
52  if (pHGCHEFDigis.isValid()) {
53  worker_->runHGCHEsil(es.getHandle(hef_geometry_token_), *pHGCHEFDigis, *hefUncalibRechits);
54  evt.put(std::move(hefUncalibRechits), hefHitCollection_);
55  }
56  // loop over HGCHEscint digis
57  const auto& pHGCHEBDigis = evt.getHandle(hebDigiCollection_);
58  if (pHGCHEBDigis.isValid()) {
59  worker_->runHGCHEscint(es.getHandle(heb_geometry_token_), *pHGCHEBDigis, *hebUncalibRechits);
60  evt.put(std::move(hebUncalibRechits), hebHitCollection_);
61  }
62  // loop over HFNose digis
63  const auto& pHGCHFNoseDigis = evt.getHandle(hfnoseDigiCollection_);
64  if (pHGCHFNoseDigis.isValid()) {
65  worker_->runHGCHFNose(es.getHandle(hfnose_geometry_token_), *pHGCHFNoseDigis, *hfnoseUncalibRechits);
66  evt.put(std::move(hfnoseUncalibRechits), hfnoseHitCollection_);
67  }
68 }
69 
71  // HGCalUncalibRecHit
73  desc.add<edm::InputTag>("HGCEEdigiCollection", edm::InputTag("hgcalDigis", "EE"));
74  desc.add<std::string>("HGCEEhitCollection", "HGCEEUncalibRecHits");
75  desc.add<edm::InputTag>("HGCHEFdigiCollection", edm::InputTag("hgcalDigis", "HEfront"));
76  desc.add<std::string>("HGCHEFhitCollection", "HGCHEFUncalibRecHits");
77  desc.add<edm::InputTag>("HGCHEBdigiCollection", edm::InputTag("hgcalDigis", "HEback"));
78  desc.add<std::string>("HGCHEBhitCollection", "HGCHEBUncalibRecHits");
79  desc.add<edm::InputTag>("HGCHFNosedigiCollection", edm::InputTag("hfnoseDigis", "HFNose"));
80  desc.add<std::string>("HGCHFNosehitCollection", "HGCHFNoseUncalibRecHits");
81  edm::ParameterSetDescription HGCEEConfigPSet;
82  HGCEEConfigPSet.add<bool>("isSiFE", true);
83  HGCEEConfigPSet.add<unsigned int>("adcNbits", 10);
84  HGCEEConfigPSet.add<double>("adcSaturation", 100);
85  HGCEEConfigPSet.add<unsigned int>("tdcNbits", 12);
86  HGCEEConfigPSet.add<double>("tdcSaturation", 10000);
87  HGCEEConfigPSet.add<double>("tdcOnset", 60);
88  HGCEEConfigPSet.add<double>("toaLSB_ns", 0.0244);
89  HGCEEConfigPSet.add<double>("tofDelay", -9);
90  HGCEEConfigPSet.add<std::vector<double>>("fCPerMIP",
91  {
92  1.25,
93  2.57,
94  3.88,
95  });
96  desc.add<edm::ParameterSetDescription>("HGCEEConfig", HGCEEConfigPSet);
97  edm::ParameterSetDescription HGCHEFConfigPSet;
98  HGCHEFConfigPSet.add<bool>("isSiFE", true);
99  HGCHEFConfigPSet.add<unsigned int>("adcNbits", 10);
100  HGCHEFConfigPSet.add<double>("adcSaturation", 100);
101  HGCHEFConfigPSet.add<unsigned int>("tdcNbits", 12);
102  HGCHEFConfigPSet.add<double>("tdcSaturation", 10000);
103  HGCHEFConfigPSet.add<double>("tdcOnset", 60);
104  HGCHEFConfigPSet.add<double>("toaLSB_ns", 0.0244);
105  HGCHEFConfigPSet.add<double>("tofDelay", -11);
106  HGCHEFConfigPSet.add<std::vector<double>>("fCPerMIP",
107  {
108  1.25,
109  2.57,
110  3.88,
111  });
112  desc.add<edm::ParameterSetDescription>("HGCHEFConfig", HGCHEFConfigPSet);
113  edm::ParameterSetDescription HGCHEBConfigPSet;
114  HGCHEBConfigPSet.add<bool>("isSiFE", true);
115  HGCHEBConfigPSet.add<unsigned int>("adcNbits", 10);
116  HGCHEBConfigPSet.add<double>("adcSaturation", 68.75);
117  HGCHEBConfigPSet.add<unsigned int>("tdcNbits", 12);
118  HGCHEBConfigPSet.add<double>("tdcSaturation", 1000);
119  HGCHEBConfigPSet.add<double>("tdcOnset", 55);
120  HGCHEBConfigPSet.add<double>("toaLSB_ns", 0.0244);
121  HGCHEBConfigPSet.add<double>("tofDelay", -14);
122  HGCHEBConfigPSet.add<std::vector<double>>("fCPerMIP",
123  {
124  1.0,
125  1.0,
126  1.0,
127  });
128  desc.add<edm::ParameterSetDescription>("HGCHEBConfig", HGCHEBConfigPSet);
129  edm::ParameterSetDescription HGCHFNoseConfigPSet;
130  HGCHFNoseConfigPSet.add<bool>("isSiFE", false);
131  HGCHFNoseConfigPSet.add<unsigned int>("adcNbits", 10);
132  HGCHFNoseConfigPSet.add<double>("adcSaturation", 100);
133  HGCHFNoseConfigPSet.add<unsigned int>("tdcNbits", 12);
134  HGCHFNoseConfigPSet.add<double>("tdcSaturation", 10000);
135  HGCHFNoseConfigPSet.add<double>("tdcOnset", 60);
136  HGCHFNoseConfigPSet.add<double>("toaLSB_ns", 0.0244);
137  HGCHFNoseConfigPSet.add<double>("tofDelay", -33);
138  HGCHFNoseConfigPSet.add<std::vector<double>>("fCPerMIP",
139  {
140  1.25,
141  2.57,
142  3.88,
143  });
144  desc.add<edm::ParameterSetDescription>("HGCHFNoseConfig", HGCHFNoseConfigPSet);
145  desc.add<std::string>("algo", "HGCalUncalibRecHitWorkerWeights");
146  desc.add<bool>("computeLocalTime", false);
147  descriptions.add("HGCalUncalibRecHitProducer", desc);
148 }
149 
151 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EDGetTokenT< HGCalDigiCollection > eeDigiCollection_
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > hfnose_geometry_token_
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > ee_geometry_token_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const edm::EDGetTokenT< HGCalDigiCollection > hebDigiCollection_
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > heb_geometry_token_
const edm::EDGetTokenT< HGCalDigiCollection > hefDigiCollection_
std::unique_ptr< HGCalUncalibRecHitWorkerBaseClass > worker_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HGCalUncalibRecHitProducer(const edm::ParameterSet &ps)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:550
HLT enums.
void produce(edm::Event &evt, const edm::EventSetup &es) override
#define get
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > hef_geometry_token_
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< HGCalDigiCollection > hfnoseDigiCollection_