CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MeasurementTrackerSiStripRefGetterProducer.cc
Go to the documentation of this file.
2 
5 
7 
8 //measurement tracker
11 
12 
13 using namespace std;
14 //using namespace sistrip;
15 
16 // -----------------------------------------------------------------------------
17 //
20  inputModuleLabel_(conf.getParameter<edm::InputTag>("InputModuleLabel")),
21  cabling_()
22 {
23  produces< RefGetter >();
24  // produces< MeasurementTrackerEvent >(); // already done by base class
25 }
26 
27 // -----------------------------------------------------------------------------
29 
30 // -----------------------------------------------------------------------------
32  //get cabling
33  setup.get<SiStripRegionCablingRcd>().get(cabling_);
34 }
35 
36 // -----------------------------------------------------------------------------
39  const edm::EventSetup& setup ) {
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 }
85 
86 void
87 MeasurementTrackerSiStripRefGetterProducer::updateStrips( const edm::Event& event, StMeasurementDetSet & theStDets, std::vector<bool> & stripClustersToSkip ) const
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 }
104 
105 
#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 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
virtual void produce(edm::Event &, const edm::EventSetup &) override
void updatePixels(const edm::Event &, PxMeasurementDetSet &thePxDets, std::vector< bool > &pixelClustersToSkip) const
edm::InputTag inputModuleLabel_
Input module label of SiStripLazyGetter.
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple conf
Definition: dbtoconf.py:185
edm::ESHandle< SiStripRegionCabling > cabling_
Cabling.
tuple out
Definition: dbtoconf.py:99
std::vector< uint32_t > & rawInactiveStripDetIds()
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
virtual void beginRun(edm::Run const &, const edm::EventSetup &) override
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition: Run.h:41