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::EDConsumerBase 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
 
- 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 
double ptrackPhi_
 
bool random_
 
double taujetdeta_
 
double taujetdphi_
 
bool taujets_
 
edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
tok_ptrack_
 
edm::EDGetTokenT< LazyGettertok_siStrip_
 
edm::EDGetTokenT
< l1extra::L1JetParticleCollection
tok_tauL1_
 

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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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.

References edm::ParameterSet::getParameter(), tok_ptrack_, tok_siStrip_, and tok_tauL1_.

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  taujetdeta_(conf.getUntrackedParameter<double>("tjetEtaWindow",0.2)),
20  taujetdphi_(conf.getUntrackedParameter<double>("tjetPhiWindow",0.2)),
21  ptrackEta_(conf.getUntrackedParameter<double>("ptrackEtaWindow",0.3)),
22  ptrackPhi_(conf.getUntrackedParameter<double>("ptrackPhiWindow",0.3))
23 
24 {
25  tok_siStrip_ = consumes<LazyGetter>(conf.getParameter<edm::InputTag>("siStripLazyGetter"));
26  tok_tauL1_ = consumes<l1extra::L1JetParticleCollection>(conf.getParameter<edm::InputTag>("l1tauJetLabel"));
27  tok_ptrack_ = consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("pixelTrackLabel"));
28 
29  produces< RefGetter >();
30 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_ptrack_
edm::EDGetTokenT< LazyGetter > tok_siStrip_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_tauL1_
edm::ESHandle< SiStripRegionCabling > cabling_
std::vector< uint32_t > allregions_
HITSiStripRawToClustersRoI::~HITSiStripRawToClustersRoI ( )

Definition at line 32 of file HITSiStripRawToClustersRoI.cc.

32 {}

Member Function Documentation

void HITSiStripRawToClustersRoI::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 34 of file HITSiStripRawToClustersRoI.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 36 of file HITSiStripRawToClustersRoI.cc.

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

Defines allowed physical layer numbers

Definition at line 91 of file HITSiStripRawToClustersRoI.cc.

References nlayers_, and SiStripRegionCabling::physicalLayer().

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

91  {
92  int signedlayer = static_cast<int>(SiStripRegionCabling::physicalLayer(subdet,layer));
93  return (nlayers_ == -1 || signedlayer < nlayers_) ? true : false;
94 }
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 38 of file HITSiStripRawToClustersRoI.cc.

References allregions_, cabling_, runEdmFileComparison::collection, SiStripRegionCabling::elementIndex(), edm::EventSetup::get(), global_, cmsHarvester::index, ptrack_, ptracks(), random(), random_, taujets(), taujets_, tok_ptrack_, tok_siStrip_, and tok_tauL1_.

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

38  {
39 
40  setup.get<SiStripRegionCablingRcd>().get(cabling_);
41  allregions_.reserve(cabling_->getRegionCabling().size());
42  for (uint32_t iregion=0;iregion<cabling_->getRegionCabling().size();iregion++) {
43  for (uint32_t isubdet=0;isubdet<cabling_->getRegionCabling()[iregion].size();isubdet++) {
44  for (uint32_t ilayer=0;ilayer<cabling_->getRegionCabling()[iregion][isubdet].size();ilayer++) {
45  uint32_t index = SiStripRegionCabling::elementIndex(iregion,static_cast<SubDet>(isubdet),ilayer);
46  allregions_.push_back(index);
47  }
48  }
49  }
50 
51 
52  edm::Handle< LazyGetter > lazygetter;
53  event.getByToken(tok_siStrip_,lazygetter);
54 
56 
57  if (global_) {
58  std::auto_ptr<RefGetter> globalrefgetter(new RefGetter(lazygetter,allregions_));
59  /*//unpack
60  for (RefGetter::const_iterator iReg = globalrefgetter->begin(); iReg != globalrefgetter->end(); iReg++) *iReg;*/
61  event.put(globalrefgetter);
62  return;
63  }
64 
65  std::auto_ptr<RefGetter> refgetter(new RefGetter(allregions_.size()));
66  refgetter->reserve(10000);
67 
69 
70  if (random_) {random(*refgetter,lazygetter);}
71 
73 
74  if (taujets_) {
76  event.getByToken(tok_tauL1_,collection);
77  taujets(*collection,*refgetter,lazygetter);
78  }
79 
80 
82  if (ptrack_) {
84  event.getByToken(tok_ptrack_,collection);
85  ptracks(*collection,*refgetter,lazygetter);
86  }
87 
88  event.put(refgetter);
89 }
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::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_ptrack_
edm::EDGetTokenT< LazyGetter > tok_siStrip_
edm::EDGetTokenT< l1extra::L1JetParticleCollection > tok_tauL1_
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 128 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().

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

Defines regions of interest randomly

Definition at line 96 of file HITSiStripRawToClustersRoI.cc.

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

Referenced by produce().

96  {
97 
98  uint32_t total = cabling_->getRegionCabling().size();
99  uint32_t required = static_cast<uint32_t>(CLHEP::RandFlat::shoot()*(total+1));
100  for (uint32_t iregion = 0; iregion < required; iregion++) {
101  for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
102  SubDet subdet = static_cast<SubDet>(isubdet);
103  for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
104  if (!physicalLayer(subdet,ilayer)) break;
105  cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,SiStripRegionCabling::elementIndex(iregion,subdet,ilayer));
106  }
107  }
108  }
109 }
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 112 of file HITSiStripRawToClustersRoI.cc.

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

Referenced by produce().

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

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().

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().

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().

bool HITSiStripRawToClustersRoI::taujets_
private

Definition at line 78 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HITSiStripRawToClustersRoI::tok_ptrack_
private

Definition at line 84 of file HITSiStripRawToClustersRoI.h.

Referenced by HITSiStripRawToClustersRoI(), and produce().

edm::EDGetTokenT<LazyGetter> HITSiStripRawToClustersRoI::tok_siStrip_
private

reco module labels to define regions of interest

Definition at line 82 of file HITSiStripRawToClustersRoI.h.

Referenced by HITSiStripRawToClustersRoI(), and produce().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> HITSiStripRawToClustersRoI::tok_tauL1_
private

Definition at line 83 of file HITSiStripRawToClustersRoI.h.

Referenced by HITSiStripRawToClustersRoI(), and produce().