CMS 3D CMS Logo

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

List of all members.

Public Types

typedef edm::LazyGetter
< SiStripCluster
LazyGetter
typedef
SiStripRegionCabling::Position 
Position
typedef edm::RefGetter
< SiStripCluster
RefGetter
typedef
SiStripRegionCabling::SubDet 
SubDet

Public Member Functions

virtual void beginJob ()
virtual void endJob ()
 HITSiStripRawToClustersRoI (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~HITSiStripRawToClustersRoI ()

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_

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.

                                                                                  :

  cabling_(),
  allregions_(),
  nlayers_(conf.getUntrackedParameter<int>("layers",-1)),
  global_(conf.getUntrackedParameter<bool>("doGlobal",true)),
  random_(conf.getUntrackedParameter<bool>("random",false)),
  taujets_(conf.getUntrackedParameter<bool>("useTauJets",false)),
  ptrack_(conf.getUntrackedParameter<bool>("usePixelTracks",true)),
  siStripLazyGetter_(conf.getParameter<edm::InputTag>("siStripLazyGetter")),
  taujetL1_(conf.getParameter<edm::InputTag>("l1tauJetLabel")),
  ptrackLabel_(conf.getParameter<edm::InputTag>("pixelTrackLabel")),
  taujetdeta_(conf.getUntrackedParameter<double>("tjetEtaWindow",0.2)),
  taujetdphi_(conf.getUntrackedParameter<double>("tjetPhiWindow",0.2)),
  ptrackEta_(conf.getUntrackedParameter<double>("ptrackEtaWindow",0.3)),
  ptrackPhi_(conf.getUntrackedParameter<double>("ptrackPhiWindow",0.3))
           
{
  produces< RefGetter >();
}
HITSiStripRawToClustersRoI::~HITSiStripRawToClustersRoI ( )

Definition at line 31 of file HITSiStripRawToClustersRoI.cc.

{}

Member Function Documentation

void HITSiStripRawToClustersRoI::beginJob ( void  ) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 33 of file HITSiStripRawToClustersRoI.cc.

{}
void HITSiStripRawToClustersRoI::endJob ( void  ) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 35 of file HITSiStripRawToClustersRoI.cc.

{}
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_.

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

                                                                                    {
  int signedlayer = static_cast<int>(SiStripRegionCabling::physicalLayer(subdet,layer));
  return (nlayers_ == -1 || signedlayer < nlayers_) ? true : false;
}
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_.

                                                                                    {

  setup.get<SiStripRegionCablingRcd>().get(cabling_);
  allregions_.reserve(cabling_->getRegionCabling().size());
  for (uint32_t iregion=0;iregion<cabling_->getRegionCabling().size();iregion++) {
    for (uint32_t isubdet=0;isubdet<cabling_->getRegionCabling()[iregion].size();isubdet++) {
      for (uint32_t ilayer=0;ilayer<cabling_->getRegionCabling()[iregion][isubdet].size();ilayer++) {
        uint32_t index = SiStripRegionCabling::elementIndex(iregion,static_cast<SubDet>(isubdet),ilayer);
        allregions_.push_back(index);
      }
    }
  }

  
  edm::Handle< LazyGetter > lazygetter;
  event.getByLabel(siStripLazyGetter_,lazygetter);

  
  if (global_) {
    std::auto_ptr<RefGetter> globalrefgetter(new RefGetter(lazygetter,allregions_));
    /*//unpack
      for (RefGetter::const_iterator iReg = globalrefgetter->begin(); iReg != globalrefgetter->end(); iReg++) *iReg;*/
    event.put(globalrefgetter);
    return;
  }
  
  std::auto_ptr<RefGetter> refgetter(new RefGetter(allregions_.size()));
  refgetter->reserve(10000);
  
  
  if (random_) {random(*refgetter,lazygetter);}
  

  if (taujets_) {
        edm::Handle<l1extra::L1JetParticleCollection> collection;
        event.getByLabel(taujetL1_,collection);
        taujets(*collection,*refgetter,lazygetter);
    }


  if (ptrack_) {
      edm::Handle<trigger::TriggerFilterObjectWithRefs> collection;
      event.getByLabel(ptrackLabel_,collection);
      ptracks(*collection,*refgetter,lazygetter);
    }
  
  event.put(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(), L1TEmulatorMonitor_cff::p, phi, physicalLayer(), position, ptrackEta_, ptrackPhi_, and trigger::TriggerTrack.

Referenced by produce().

                                                                                                                                                            {

  std::vector< edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
  collection.getObjects(trigger::TriggerTrack, isoPixTrackRefs);
  for (uint32_t p=0 ; p<isoPixTrackRefs.size(); p++) {
    Position position(isoPixTrackRefs[p]->track()->eta(),isoPixTrackRefs[p]->track()->phi());
    for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
      SubDet subdet = static_cast<SubDet>(isubdet);
      for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
        if (!physicalLayer(subdet,ilayer)) break;
        cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,position,ptrackEta_,ptrackPhi_,subdet,ilayer);
      }
    }
    
  }
}
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(), and pileupDistInMC::total.

Referenced by produce().

                                                                                                     {
  
  uint32_t total = cabling_->getRegionCabling().size();
  uint32_t required = static_cast<uint32_t>(CLHEP::RandFlat::shoot()*(total+1));
  for (uint32_t iregion = 0; iregion < required; iregion++) {
    for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
      SubDet subdet = static_cast<SubDet>(isubdet);
      for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
        if (!physicalLayer(subdet,ilayer)) break;
        cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,SiStripRegionCabling::elementIndex(iregion,subdet,ilayer));
      }
    }
  }
}
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().

                                                                                                                                                        {

  l1extra::L1JetParticleCollection::const_iterator icollection = collection.begin();
  for (; icollection!=collection.end(); icollection++) {
    Position position(icollection->eta(),icollection->phi());
    for (uint32_t isubdet = 0; isubdet < SiStripRegionCabling::ALLSUBDETS; isubdet++) {
      SubDet subdet = static_cast<SubDet>(isubdet);
      for (uint32_t ilayer = 0; ilayer < SiStripRegionCabling::ALLLAYERS; ilayer++) {
        if (!physicalLayer(subdet,ilayer)) break;
        cabling_->updateSiStripRefGetter<SiStripCluster>(refgetter,lazygetter,position,taujetdeta_,taujetdphi_,subdet,ilayer);
      }
    }    
  }
}

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

Cabling

Definition at line 67 of file HITSiStripRawToClustersRoI.h.

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

Booleans to define objects of interest

Definition at line 76 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

Layers of SST to unpack (from innermost)

Definition at line 73 of file HITSiStripRawToClustersRoI.h.

Referenced by physicalLayer().

Definition at line 79 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

Definition at line 90 of file HITSiStripRawToClustersRoI.h.

Referenced by ptracks().

Definition at line 84 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

Definition at line 91 of file HITSiStripRawToClustersRoI.h.

Referenced by ptracks().

Definition at line 77 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

reco module labels to define regions of interest

Definition at line 82 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

deta/dphi to define regions of interest around physics objects

Definition at line 88 of file HITSiStripRawToClustersRoI.h.

Referenced by taujets().

Definition at line 89 of file HITSiStripRawToClustersRoI.h.

Referenced by taujets().

Definition at line 83 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().

Definition at line 78 of file HITSiStripRawToClustersRoI.h.

Referenced by produce().