CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
HITSiStripRawToClustersRoI Class Reference

#include <HITSiStripRawToClustersRoI.h>

Inheritance diagram for HITSiStripRawToClustersRoI:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Types

typedef edm::LazyGetter
< SiStripCluster
LazyGetter
 
typedef
SiStripRegionCabling::Position 
Position
 
typedef edm::RefGetter
< SiStripCluster
RefGetter
 
typedef
SiStripRegionCabling::SubDet 
SubDet
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
 HITSiStripRawToClustersRoI (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HITSiStripRawToClustersRoI ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

bool physicalLayer (SubDet &, uint32_t &) const
 
void ptracks (const trigger::TriggerFilterObjectWithRefs &, RefGetter &, edm::Handle< LazyGetter > &) const
 
void random (RefGetter &, edm::Handle< LazyGetter > &) const
 
void taujets (const l1extra::L1JetParticleCollection &, RefGetter &, edm::Handle< LazyGetter > &) const
 

Private Attributes

std::vector< uint32_t > allregions_
 
edm::ESHandle
< SiStripRegionCabling
cabling_
 
bool global_
 
int nlayers_
 
bool ptrack_
 
double ptrackEta_
 
edm::InputTag ptrackLabel_
 
double ptrackPhi_
 
bool random_
 
edm::InputTag siStripLazyGetter_
 
double taujetdeta_
 
double taujetdphi_
 
edm::InputTag taujetL1_
 
bool taujets_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 36 of file HITSiStripRawToClustersRoI.h.

Member Typedef Documentation

Definition at line 40 of file HITSiStripRawToClustersRoI.h.

Definition at line 42 of file HITSiStripRawToClustersRoI.h.

Definition at line 41 of file HITSiStripRawToClustersRoI.h.

Definition at line 43 of file HITSiStripRawToClustersRoI.h.

Constructor & Destructor Documentation

HITSiStripRawToClustersRoI::HITSiStripRawToClustersRoI ( const edm::ParameterSet conf)

Definition at line 10 of file HITSiStripRawToClustersRoI.cc.

10  :
11 
12  cabling_(),
13  allregions_(),
14  nlayers_(conf.getUntrackedParameter<int>("layers",-1)),
15  global_(conf.getUntrackedParameter<bool>("doGlobal",true)),
16  random_(conf.getUntrackedParameter<bool>("random",false)),
17  taujets_(conf.getUntrackedParameter<bool>("useTauJets",false)),
18  ptrack_(conf.getUntrackedParameter<bool>("usePixelTracks",true)),
19  siStripLazyGetter_(conf.getParameter<edm::InputTag>("siStripLazyGetter")),
20  taujetL1_(conf.getParameter<edm::InputTag>("l1tauJetLabel")),
21  ptrackLabel_(conf.getParameter<edm::InputTag>("pixelTrackLabel")),
22  taujetdeta_(conf.getUntrackedParameter<double>("tjetEtaWindow",0.2)),
23  taujetdphi_(conf.getUntrackedParameter<double>("tjetPhiWindow",0.2)),
24  ptrackEta_(conf.getUntrackedParameter<double>("ptrackEtaWindow",0.3)),
25  ptrackPhi_(conf.getUntrackedParameter<double>("ptrackPhiWindow",0.3))
26 
27 {
28  produces< RefGetter >();
29 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ESHandle< SiStripRegionCabling > cabling_
std::vector< uint32_t > allregions_
HITSiStripRawToClustersRoI::~HITSiStripRawToClustersRoI ( )

Definition at line 31 of file HITSiStripRawToClustersRoI.cc.

31 {}

Member Function Documentation

void HITSiStripRawToClustersRoI::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 33 of file HITSiStripRawToClustersRoI.cc.

33 {}
void HITSiStripRawToClustersRoI::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 35 of file HITSiStripRawToClustersRoI.cc.

35 {}
bool HITSiStripRawToClustersRoI::physicalLayer ( SubDet subdet,
uint32_t &  layer 
) const
private

Defines allowed physical layer numbers

Definition at line 90 of file HITSiStripRawToClustersRoI.cc.

References nlayers_, and SiStripRegionCabling::physicalLayer().

Referenced by ptracks(), random(), and taujets().

90  {
91  int signedlayer = static_cast<int>(SiStripRegionCabling::physicalLayer(subdet,layer));
92  return (nlayers_ == -1 || signedlayer < nlayers_) ? true : false;
93 }
static const uint32_t physicalLayer(const SubDet, const uint32_t layer)
void HITSiStripRawToClustersRoI::produce ( edm::Event event,
const edm::EventSetup setup 
)
virtual

All regions

Random region number. Starts from 0.

Seeded by L1 taujets.

seeded by isol tracks

Implements edm::EDProducer.

Definition at line 37 of file HITSiStripRawToClustersRoI.cc.

References allregions_, cabling_, runEdmFileComparison::collection, SiStripRegionCabling::elementIndex(), edm::EventSetup::get(), global_, getHLTprescales::index, ptrack_, ptrackLabel_, ptracks(), random(), random_, siStripLazyGetter_, taujetL1_, taujets(), and taujets_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

37  {
38 
39  setup.get<SiStripRegionCablingRcd>().get(cabling_);
40  allregions_.reserve(cabling_->getRegionCabling().size());
41  for (uint32_t iregion=0;iregion<cabling_->getRegionCabling().size();iregion++) {
42  for (uint32_t isubdet=0;isubdet<cabling_->getRegionCabling()[iregion].size();isubdet++) {
43  for (uint32_t ilayer=0;ilayer<cabling_->getRegionCabling()[iregion][isubdet].size();ilayer++) {
44  uint32_t index = SiStripRegionCabling::elementIndex(iregion,static_cast<SubDet>(isubdet),ilayer);
45  allregions_.push_back(index);
46  }
47  }
48  }
49 
50 
51  edm::Handle< LazyGetter > lazygetter;
52  event.getByLabel(siStripLazyGetter_,lazygetter);
53 
55 
56  if (global_) {
57  std::auto_ptr<RefGetter> globalrefgetter(new RefGetter(lazygetter,allregions_));
58  /*//unpack
59  for (RefGetter::const_iterator iReg = globalrefgetter->begin(); iReg != globalrefgetter->end(); iReg++) *iReg;*/
60  event.put(globalrefgetter);
61  return;
62  }
63 
64  std::auto_ptr<RefGetter> refgetter(new RefGetter(allregions_.size()));
65  refgetter->reserve(10000);
66 
68 
69  if (random_) {random(*refgetter,lazygetter);}
70 
72 
73  if (taujets_) {
75  event.getByLabel(taujetL1_,collection);
76  taujets(*collection,*refgetter,lazygetter);
77  }
78 
79 
81  if (ptrack_) {
83  event.getByLabel(ptrackLabel_,collection);
84  ptracks(*collection,*refgetter,lazygetter);
85  }
86 
87  event.put(refgetter);
88 }
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
void ptracks(const trigger::TriggerFilterObjectWithRefs &, RefGetter &, edm::Handle< LazyGetter > &) const
void taujets(const l1extra::L1JetParticleCollection &, RefGetter &, edm::Handle< LazyGetter > &) const
edm::ESHandle< SiStripRegionCabling > cabling_
void random(RefGetter &, edm::Handle< LazyGetter > &) const
const T & get() const
Definition: EventSetup.h:55
std::vector< uint32_t > allregions_
edm::RefGetter< SiStripCluster > RefGetter
void HITSiStripRawToClustersRoI::ptracks ( const trigger::TriggerFilterObjectWithRefs collection,
RefGetter refgetter,
edm::Handle< LazyGetter > &  lazygetter 
) const
private

seeding by isolated pixel tracks

Definition at line 127 of file HITSiStripRawToClustersRoI.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, cabling_, eta(), trigger::TriggerRefsCollections::getObjects(), AlCaHLTBitMon_ParallelJobs::p, phi, physicalLayer(), position, ptrackEta_, ptrackPhi_, and trigger::TriggerTrack.

Referenced by produce().

127  {
128 
129  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
130  collection.getObjects(trigger::TriggerTrack, isoPixTrackRefs);
131  for (uint32_t p=0 ; p<isoPixTrackRefs.size(); p++) {
132  Position position(isoPixTrackRefs[p]->track()->eta(),isoPixTrackRefs[p]->track()->phi());
133  for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
134  SubDet subdet = static_cast<SubDet>(isubdet);
135  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
136  if (!physicalLayer(subdet,ilayer)) break;
137  cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,position,ptrackEta_,ptrackPhi_,subdet,ilayer);
138  }
139  }
140 
141  }
142 }
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
SiStripRegionCabling::Position Position
SiStripRegionCabling::SubDet SubDet
T eta() const
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
edm::ESHandle< SiStripRegionCabling > cabling_
bool physicalLayer(SubDet &, uint32_t &) const
Definition: DDAxes.h:10
void HITSiStripRawToClustersRoI::random ( RefGetter refgetter,
edm::Handle< LazyGetter > &  lazygetter 
) const
private

Defines regions of interest randomly

Definition at line 95 of file HITSiStripRawToClustersRoI.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, cabling_, SiStripRegionCabling::elementIndex(), physicalLayer(), dumpFill::required, and pileupDistInMC::total.

Referenced by produce().

95  {
96 
97  uint32_t total = cabling_->getRegionCabling().size();
98  uint32_t required = static_cast<uint32_t>(CLHEP::RandFlat::shoot()*(total+1));
99  for (uint32_t iregion = 0; iregion < required; iregion++) {
100  for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
101  SubDet subdet = static_cast<SubDet>(isubdet);
102  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
103  if (!physicalLayer(subdet,ilayer)) break;
104  cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,SiStripRegionCabling::elementIndex(iregion,subdet,ilayer));
105  }
106  }
107  }
108 }
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
SiStripRegionCabling::SubDet SubDet
edm::ESHandle< SiStripRegionCabling > cabling_
bool physicalLayer(SubDet &, uint32_t &) const
void HITSiStripRawToClustersRoI::taujets ( const l1extra::L1JetParticleCollection collection,
RefGetter refgetter,
edm::Handle< LazyGetter > &  lazygetter 
) const
private

Defines regions of interest by taujets

Definition at line 111 of file HITSiStripRawToClustersRoI.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, cabling_, physicalLayer(), position, taujetdeta_, and taujetdphi_.

Referenced by produce().

111  {
112 
113  l1extra::L1JetParticleCollection::const_iterator icollection = collection.begin();
114  for (; icollection!=collection.end(); icollection++) {
115  Position position(icollection->eta(),icollection->phi());
116  for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
117  SubDet subdet = static_cast<SubDet>(isubdet);
118  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
119  if (!physicalLayer(subdet,ilayer)) break;
120  cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,position,taujetdeta_,taujetdphi_,subdet,ilayer);
121  }
122  }
123  }
124 }
SiStripRegionCabling::Position Position
SiStripRegionCabling::SubDet SubDet
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
edm::ESHandle< SiStripRegionCabling > cabling_
bool physicalLayer(SubDet &, uint32_t &) const

Member Data Documentation

std::vector<uint32_t> HITSiStripRawToClustersRoI::allregions_
private

Record of all region numbers

Definition at line 70 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

edm::ESHandle<SiStripRegionCabling> HITSiStripRawToClustersRoI::cabling_
private

Cabling

Definition at line 67 of file HITSiStripRawToClustersRoI.h.

Referenced by produce(), ptracks(), random(), and taujets().

bool HITSiStripRawToClustersRoI::global_
private

Booleans to define objects of interest

Definition at line 76 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

int HITSiStripRawToClustersRoI::nlayers_
private

Layers of SST to unpack (from innermost)

Definition at line 73 of file HITSiStripRawToClustersRoI.h.

Referenced by physicalLayer().

bool HITSiStripRawToClustersRoI::ptrack_
private

Definition at line 79 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

double HITSiStripRawToClustersRoI::ptrackEta_
private

Definition at line 90 of file HITSiStripRawToClustersRoI.h.

Referenced by ptracks().

edm::InputTag HITSiStripRawToClustersRoI::ptrackLabel_
private

Definition at line 84 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

double HITSiStripRawToClustersRoI::ptrackPhi_
private

Definition at line 91 of file HITSiStripRawToClustersRoI.h.

Referenced by ptracks().

bool HITSiStripRawToClustersRoI::random_
private

Definition at line 77 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

edm::InputTag HITSiStripRawToClustersRoI::siStripLazyGetter_
private

reco module labels to define regions of interest

Definition at line 82 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

double HITSiStripRawToClustersRoI::taujetdeta_
private

deta/dphi to define regions of interest around physics objects

Definition at line 88 of file HITSiStripRawToClustersRoI.h.

Referenced by taujets().

double HITSiStripRawToClustersRoI::taujetdphi_
private

Definition at line 89 of file HITSiStripRawToClustersRoI.h.

Referenced by taujets().

edm::InputTag HITSiStripRawToClustersRoI::taujetL1_
private

Definition at line 83 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

bool HITSiStripRawToClustersRoI::taujets_
private

Definition at line 78 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().