CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTSegment4DT0Corrector.cc
Go to the documentation of this file.
1 
8 
14 
16 
18 
19 using namespace edm;
20 using namespace std;
21 
23  produces<DTRecSegment4DCollection>();
24 
25  // debug parameter
26  debug = pset.getUntrackedParameter<bool>("debug");
27 
28  if(debug)
29  cout << "[DTSegment4DT0Corrector] Constructor called" << endl;
30 
31  // the name of the 4D rec hits collection
32  recHits4DToken_ = consumes<DTRecSegment4DCollection>(pset.getParameter<InputTag>("recHits4DLabel"));
33 
34  // the updator
35  theUpdator = new DTSegmentUpdator(pset);
36 }
37 
40  if(debug)
41  cout << "[DTSegment4DT0Corrector] Destructor called" << endl;
42  delete theUpdator;
43 }
44 
46 
47  // Get the 4D Segment from the event
49  event.getByToken(recHits4DToken_, all4DSegments);
50 
51  // get the geometry
52  ESHandle<DTGeometry> theGeom;
53  setup.get<MuonGeometryRecord>().get(theGeom);
54 
55  // Percolate the setup
56  theUpdator->setES(setup);
57 
58 
59  // Create the pointer to the collection which will store the rechits
60  auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection());
61 
62  // Iterate over the input DTSegment4D
63  DTRecSegment4DCollection::id_iterator chamberId;
64 
65  if(debug)
66  cout << "[DTSegment4DT0Corrector] Starting to loop over segments" << endl;
67 
68  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId){
69 
71 
72  // Get the range for the corresponding ChamerId
73  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
74 
75  // Loop over the rechits of this ChamberId
76  for (DTRecSegment4DCollection::const_iterator segment4D = range.first;
77  segment4D!=range.second; ++segment4D) {
78 
79  DTRecSegment4D tmpseg = *segment4D;
80 
81  DTRecSegment4D *newSeg = tmpseg.clone();
82 
83  if(newSeg == 0) continue;
84 
85  theUpdator->update(newSeg,true,0);
86  result.push_back(*newSeg);
87 
88  }
89 
90  segments4DCollection->put(*chamberId, result.begin(), result.end());
91 
92  }
93 
94  if(debug)
95  cout << "[DTSegment4DT0Corrector] Saving modified segments into the event" << endl;
96 
97  // Load the output in the Event
98  event.put(segments4DCollection);
99 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual DTRecSegment4D * clone() const
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
DTSegment4DT0Corrector(const edm::ParameterSet &)
Constructor.
iterator begin()
Definition: OwnVector.h:234
void push_back(D *&d)
Definition: OwnVector.h:280
virtual void produce(edm::Event &event, const edm::EventSetup &setup)
The method which produces the 4D rec segments corrected for t0 offset.
tuple result
Definition: query.py:137
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
iterator end()
Definition: OwnVector.h:239
#define debug
Definition: HDRShower.cc:19
const T & get() const
Definition: EventSetup.h:56
edm::RangeMap< DTChamberId, edm::OwnVector< DTRecSegment4D > > DTRecSegment4DCollection
tuple cout
Definition: gather_cfg.py:121
virtual ~DTSegment4DT0Corrector()
Destructor.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")