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
MeasurementTrackerSiStripRefGetterProducer Class Reference

#include <MeasurementTrackerSiStripRefGetterProducer.h>

Inheritance diagram for MeasurementTrackerSiStripRefGetterProducer:
MeasurementTrackerEventProducer edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef edm::LazyGetter
< SiStripCluster
LazyGetter
 
typedef edm::RefGetter
< SiStripCluster
RefGetter
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginRun (edm::Run const &, const edm::EventSetup &) override
 
 MeasurementTrackerSiStripRefGetterProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~MeasurementTrackerSiStripRefGetterProducer ()
 
- Public Member Functions inherited from MeasurementTrackerEventProducer
 MeasurementTrackerEventProducer (const edm::ParameterSet &iConfig)
 
 ~MeasurementTrackerEventProducer ()
 
- 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void updateStrips (const edm::Event &event, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
 

Private Attributes

edm::ESHandle
< SiStripRegionCabling
cabling_
 Cabling. More...
 
edm::InputTag inputModuleLabel_
 Input module label of SiStripLazyGetter. More...
 

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 MeasurementTrackerEventProducer
void getInactiveStrips (const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
 
void updatePixels (const edm::Event &, PxMeasurementDetSet &thePxDets, std::vector< bool > &pixelClustersToSkip) const
 
void updateStrips (const edm::Event &, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
 
- 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)
 
- Protected Attributes inherited from MeasurementTrackerEventProducer
std::string measurementTrackerLabel_
 
const edm::ParameterSetpset_
 
bool selfUpdateSkipClusters_
 
const std::vector< edm::InputTagtheInactivePixelDetectorLabels
 
const std::vector< edm::InputTagtheInactiveStripDetectorLabels
 

Detailed Description

module to allow for unpack on demand retrieves a SiStripLazyGetter from the event retrieves a MeasurementTrackerOD from the event setup produces a SiStripRefGetter, defined by MeasurementTrackerOD::define(...) produces a MeasurementTrackerEvent and puts it into the event

Author
Jean-Roch Vlimant UCSB

Definition at line 34 of file MeasurementTrackerSiStripRefGetterProducer.h.

Member Typedef Documentation

Definition at line 38 of file MeasurementTrackerSiStripRefGetterProducer.h.

Definition at line 39 of file MeasurementTrackerSiStripRefGetterProducer.h.

Constructor & Destructor Documentation

MeasurementTrackerSiStripRefGetterProducer::MeasurementTrackerSiStripRefGetterProducer ( const edm::ParameterSet conf)

Definition at line 18 of file MeasurementTrackerSiStripRefGetterProducer.cc.

18  :
20  inputModuleLabel_(conf.getParameter<edm::InputTag>("InputModuleLabel")),
21  cabling_()
22 {
23  produces< RefGetter >();
24  // produces< MeasurementTrackerEvent >(); // already done by base class
25 }
T getParameter(std::string const &) const
MeasurementTrackerEventProducer(const edm::ParameterSet &iConfig)
edm::InputTag inputModuleLabel_
Input module label of SiStripLazyGetter.
edm::ESHandle< SiStripRegionCabling > cabling_
Cabling.
MeasurementTrackerSiStripRefGetterProducer::~MeasurementTrackerSiStripRefGetterProducer ( )

Definition at line 28 of file MeasurementTrackerSiStripRefGetterProducer.cc.

28 {}

Member Function Documentation

void MeasurementTrackerSiStripRefGetterProducer::beginRun ( edm::Run const &  ,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 31 of file MeasurementTrackerSiStripRefGetterProducer.cc.

References cabling_, and edm::EventSetup::get().

31  {
32  //get cabling
33  setup.get<SiStripRegionCablingRcd>().get(cabling_);
34 }
edm::ESHandle< SiStripRegionCabling > cabling_
Cabling.
const T & get() const
Definition: EventSetup.h:55
void MeasurementTrackerSiStripRefGetterProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from MeasurementTrackerEventProducer.

Definition at line 38 of file MeasurementTrackerSiStripRefGetterProducer.cc.

References OnDemandMeasurementTracker::define(), edm::EventSetup::get(), inputModuleLabel_, IterativeTracking_cff::MeasurementTrackerEvent, MeasurementTrackerEventProducer::measurementTrackerLabel_, dbtoconf::out, edm::ESHandle< class >::product(), MeasurementTrackerEventProducer::updatePixels(), and updateStrips().

39  {
40 
41  // Retrieve unpacking tool from event
42  edm::Handle< LazyGetter > lazygetter;
43  event.getByLabel(inputModuleLabel_,lazygetter);
44 
45  // Construct default RefGetter object
46  std::auto_ptr<RefGetter> refgetter(new RefGetter());
47 
48  //retreive the measurement tracker.
51 
52  // create new data structures from templates
53  std::auto_ptr<StMeasurementDetSet> stripData(new StMeasurementDetSet(mtESH->stripDetConditions()));
54  std::auto_ptr<PxMeasurementDetSet> pixelData(new PxMeasurementDetSet(mtESH->pixelDetConditions()));
55 
56  //cast MT to the proper type
57  const OnDemandMeasurementTracker * tOD = dynamic_cast<const OnDemandMeasurementTracker *>(mtESH.product());
58  if (!tOD){
59  edm::LogError("MeasurementTrackerSiStripRefGetterProducer")<<"casting of MeasurementTracker named: "<< measurementTrackerLabel_ <<" into OnDemandMeasurementTracker does not work.";
60  } else{
61  //define the regions for each individual module
62  tOD->define(lazygetter, *refgetter, *stripData);
63  }
64 
65  // Add to event
66  edm::OrphanHandle<edm::RefGetter<SiStripCluster> > refgetterH = event.put(refgetter);
67 
68  //std::cout << "Created new OnDemand strip data @" << &* stripData << std::endl;
69  std::vector<bool> stripClustersToSkip;
70  std::vector<bool> pixelClustersToSkip;
71 
72  // fill them
73  stripData->setLazyGetter(lazygetter);
74  stripData->setRefGetter(*refgetterH);
75  updateStrips(event, *stripData, stripClustersToSkip);
76  updatePixels(event, *pixelData, pixelClustersToSkip);
77 
78  // put into MTE
79  std::auto_ptr<MeasurementTrackerEvent> out(new MeasurementTrackerEvent(*mtESH, stripData.release(), pixelData.release(), stripClustersToSkip, pixelClustersToSkip));
80 
81  // put into event
82  event.put(out);
83 
84 }
void define(const edm::Handle< edm::LazyGetter< SiStripCluster > > &, RefGetter &, StMeasurementDetSet &) const
OnDemandMeasurementTracker specific function to be called to define the region in the RefGetter accor...
void updateStrips(const edm::Event &event, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
void updatePixels(const edm::Event &, PxMeasurementDetSet &thePxDets, std::vector< bool > &pixelClustersToSkip) const
edm::InputTag inputModuleLabel_
Input module label of SiStripLazyGetter.
tuple out
Definition: dbtoconf.py:99
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void MeasurementTrackerSiStripRefGetterProducer::updateStrips ( const edm::Event event,
StMeasurementDetSet theStDets,
std::vector< bool > &  stripClustersToSkip 
) const
private

Definition at line 87 of file MeasurementTrackerSiStripRefGetterProducer.cc.

References edm::HandleBase::clear(), edm::EventID::event(), MeasurementTrackerEventProducer::getInactiveStrips(), edm::ParameterSet::getParameter(), edm::EventBase::id(), LogDebug, MeasurementTrackerEventProducer::pset_, StMeasurementDetSet::rawInactiveStripDetIds(), edm::EventID::run(), and MeasurementTrackerEventProducer::selfUpdateSkipClusters_.

Referenced by produce().

88 {
89  LogDebug(category_)<<"Updating siStrip on event: "<< (unsigned int) event.id().run() <<" : "<<(unsigned int) event.id().event();
90 
91  //get the skip clusters
94  event.getByLabel(pset_.getParameter<edm::InputTag>("skipClusters"), theStripClusterMask);
95  theStripClusterMask->copyMaskTo(stripClustersToSkip);
96  } else {
97  stripClustersToSkip.clear();
98  }
99 
100  //get the detid that are inactive
101  theStDets.rawInactiveStripDetIds().clear();
102  getInactiveStrips(event,theStDets.rawInactiveStripDetIds());
103 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
std::vector< uint32_t > & rawInactiveStripDetIds()
edm::EventID id() const
Definition: EventBase.h:56

Member Data Documentation

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

Cabling.

Definition at line 54 of file MeasurementTrackerSiStripRefGetterProducer.h.

Referenced by beginRun().

edm::InputTag MeasurementTrackerSiStripRefGetterProducer::inputModuleLabel_
private

Input module label of SiStripLazyGetter.

Definition at line 51 of file MeasurementTrackerSiStripRefGetterProducer.h.

Referenced by produce().