CMS 3D CMS Logo

AlcaPCCProducer.cc
Go to the documentation of this file.
1 
10 // C++ standard
11 #include <string>
12 // CMS
28 //The class
30  : public edm::one::EDProducer<edm::EndLuminosityBlockProducer, edm::LuminosityBlockCache<reco::PixelClusterCounts>> {
31 public:
32  explicit AlcaPCCProducer(const edm::ParameterSet&);
33 
34 private:
35  std::shared_ptr<reco::PixelClusterCounts> globalBeginLuminosityBlock(edm::LuminosityBlock const& lumiSeg,
36  edm::EventSetup const& iSetup) const final;
37  void endLuminosityBlockProduce(edm::LuminosityBlock& lumiSeg, const edm::EventSetup& iSetup) final;
39  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) final;
40 
43 };
44 
45 //--------------------------------------------------------------------------------------------------
47  : pixelToken_(consumes(iConfig.getParameter<edm::InputTag>("pixelClusterLabel"))),
48  //specifies the trigger Rand or ZeroBias
49  putToken_(produces<reco::PixelClusterCounts, edm::Transition::EndLuminosityBlock>(
50  iConfig.getUntrackedParameter<std::string>("trigstring", "alcaPCC"))) {}
51 
52 //--------------------------------------------------------------------------------------------------
54  unsigned int bx = iEvent.bunchCrossing();
55  //std::cout<<"The Bunch Crossing"<<bx<<std::endl;
56  auto* pccOb = luminosityBlockCache(iEvent.getLuminosityBlock().index());
57  pccOb->eventCounter(bx);
58 
59  //Looping over the clusters and adding the counts up
61  // ----------------------------------------------------------------------
62  // -- Clusters without tracks
63  for (auto const& mod : clustColl) {
64  if (mod.empty()) {
65  continue;
66  }
67  DetId detId = mod.id();
68 
69  //--The following will be used when we make a theshold for the clusters.
70  //--Keeping this for features that may be implemented later.
71  // -- clusters on this det
72  //edmNew::DetSet<SiPixelCluster>::const_iterator di;
73  //int nClusterCount=0;
74  //for (di = mod.begin(); di != mod.end(); ++di) {
75  // nClusterCount++;
76  //}
77  int nCluster = mod.size();
78  pccOb->increment(detId(), bx, nCluster);
79  }
80 }
81 
82 //--------------------------------------------------------------------------------------------------
83 std::shared_ptr<reco::PixelClusterCounts> AlcaPCCProducer::globalBeginLuminosityBlock(
84  edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& iSetup) const {
85  //New PCC object at the beginning of each lumi section
86  return std::make_shared<reco::PixelClusterCounts>();
87 }
88 
89 //--------------------------------------------------------------------------------------------------
91  //Saving the PCC object
92  lumiSeg.emplace(putToken_, std::move(*luminosityBlockCache(lumiSeg.index())));
93 }
94 
ConfigurationDescriptions.h
AlcaPCCProducer::globalBeginLuminosityBlock
std::shared_ptr< reco::PixelClusterCounts > globalBeginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) const final
Definition: AlcaPCCProducer.cc:83
AlcaPCCProducer::endLuminosityBlockProduce
void endLuminosityBlockProduce(edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) final
Definition: AlcaPCCProducer.cc:90
EDProducer.h
MessageLogger.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::EDGetTokenT
Definition: EDGetToken.h:33
LuminosityBlock.h
edm::LuminosityBlock::index
LuminosityBlockIndex index() const
Definition: LuminosityBlock.cc:28
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT< reco::PixelClusterCounts >
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
SiPixelCluster.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
AlcaPCCProducer::pixelToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelToken_
Definition: AlcaPCCProducer.cc:41
edm::one::EDProducer
Definition: EDProducer.h:30
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
edm::LuminosityBlock::emplace
void emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
Definition: LuminosityBlock.h:249
PixelClusterCounts.h
DetId
Definition: DetId.h:17
AlcaPCCProducer::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) final
Definition: AlcaPCCProducer.cc:38
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterSetDescription.h
EDGetToken.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edmNew::DetSetVector
Definition: DetSetNew.h:13
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
AlcaPCCProducer
Definition: AlcaPCCProducer.cc:29
DetId.h
Frameworkfwd.h
AlcaPCCProducer::putToken_
edm::EDPutTokenT< reco::PixelClusterCounts > putToken_
Definition: AlcaPCCProducer.cc:42
EventSetup.h
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition: Event.h:73
AlcaPCCProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) final
Definition: AlcaPCCProducer.cc:53
AlcaPCCProducer::AlcaPCCProducer
AlcaPCCProducer(const edm::ParameterSet &)
Definition: AlcaPCCProducer.cc:46