CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTRefitAndCombineReco4D Class Reference

#include <DTRefitAndCombineReco4D.h>

Inheritance diagram for DTRefitAndCombineReco4D:
DTRecSegment4DBaseAlgo

Public Member Functions

virtual std::string algoName () const
 
 DTRefitAndCombineReco4D (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual edm::OwnVector
< DTRecSegment4D
reconstruct ()
 Operations. More...
 
virtual void setChamber (const DTChamberId &chId)
 
virtual void setDTRecHit1DContainer (edm::Handle< DTRecHitCollection > all1DHits)
 
virtual void setDTRecSegment2DContainer (edm::Handle< DTRecSegment2DCollection > all2DSegments)
 
virtual void setES (const edm::EventSetup &setup)
 
virtual bool wants2DSegments ()
 
virtual ~DTRefitAndCombineReco4D ()
 Destructor. More...
 
- Public Member Functions inherited from DTRecSegment4DBaseAlgo
 DTRecSegment4DBaseAlgo (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~DTRecSegment4DBaseAlgo ()
 Destructor. More...
 

Private Member Functions

std::vector
< DTChamberRecSegment2D
refitSuperSegments ()
 

Private Attributes

bool debug
 
std::string theAlgoName
 
const DTChambertheChamber
 
edm::ESHandle< DTGeometrytheDTGeometry
 
double theMaxChi2forPhi
 
std::vector< DTSLRecSegment2DtheSegments2DPhi1
 
std::vector< DTSLRecSegment2DtheSegments2DPhi2
 
std::vector< DTSLRecSegment2DtheSegments2DTheta
 
DTSegmentUpdatortheUpdator
 

Detailed Description

Algo for reconstructing 4d segment in DT refitting the 2D phi SL hits and combining the results with the theta view.

Date:
2006/04/28 15:21:52
Revision:
1.5
Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t
Riccardo Bellan - INFN TO ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Algo for reconstructing 4d segment in DT refitting the 2D phi SL hits and combining the results with the theta view.

Date:
2006/05/04 09:17:36
Revision:
1.5
Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t
Riccardo Bellan - INFN TO ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 41 of file DTRefitAndCombineReco4D.h.

Constructor & Destructor Documentation

DTRefitAndCombineReco4D::DTRefitAndCombineReco4D ( const edm::ParameterSet pset)

Constructor.

Definition at line 31 of file DTRefitAndCombineReco4D.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), theMaxChi2forPhi, and theUpdator.

31  :
32 DTRecSegment4DBaseAlgo(pset), theAlgoName("DTRefitAndCombineReco4D"){
33 
34  // debug parameter
35  debug = pset.getUntrackedParameter<bool>("debug");
36 
37  // the updator
38  theUpdator = new DTSegmentUpdator(pset);
39 
40  // the max allowd chi^2 for the fit of th combination of two phi segments
41  theMaxChi2forPhi = pset.getParameter<double>("MaxChi2forPhi");
42 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTRecSegment4DBaseAlgo(const edm::ParameterSet &)
Constructor.
virtual DTRefitAndCombineReco4D::~DTRefitAndCombineReco4D ( )
inlinevirtual

Destructor.

Definition at line 49 of file DTRefitAndCombineReco4D.h.

49 {};

Member Function Documentation

virtual std::string DTRefitAndCombineReco4D::algoName ( void  ) const
inlinevirtual

Implements DTRecSegment4DBaseAlgo.

Definition at line 55 of file DTRefitAndCombineReco4D.h.

References theAlgoName.

55 { return theAlgoName; }
OwnVector< DTRecSegment4D > DTRefitAndCombineReco4D::reconstruct ( )
virtual

Operations.

4d segment: I have the pos along the wire => further update!

Implements DTRecSegment4DBaseAlgo.

Definition at line 89 of file DTRefitAndCombineReco4D.cc.

References gather_cfg::cout, debug, DTChamber::id(), phi, edm::OwnVector< T, P >::push_back(), refitSuperSegments(), query::result, DTChamber::superLayer(), theChamber, theSegments2DTheta, theUpdator, GeomDet::toGlobal(), GeomDet::toLocal(), and DTSegmentUpdator::update().

89  {
91 
92  if (debug) cout << "Segments in " << theChamber->id() << endl;
93 
94  vector<DTChamberRecSegment2D> resultPhi = refitSuperSegments();
95 
96  if (debug) cout << "There are " << resultPhi.size() << " Phi cand" << endl;
97 
98  bool hasZed=false;
99 
100  // has this chamber the Z-superlayer?
101  if (theSegments2DTheta.size()){
102  hasZed = theSegments2DTheta.size()>0;
103  if (debug) cout << "There are " << theSegments2DTheta.size() << " Theta cand" << endl;
104  } else {
105  if (debug) cout << "No Theta SL" << endl;
106  }
107 
108  // Now I want to build the concrete DTRecSegment4D.
109  if (resultPhi.size()) {
110  for (vector<DTChamberRecSegment2D>::const_iterator phi=resultPhi.begin();
111  phi!=resultPhi.end(); ++phi) {
112 
113  if (hasZed) {
114 
115  // Create all the 4D-segment combining the Z view with the Phi one
116  // loop over the Z segments
117  for(vector<DTSLRecSegment2D>::const_iterator zed = theSegments2DTheta.begin();
118  zed != theSegments2DTheta.end(); ++zed){
119 
120  //>> Important!!
121  DTSuperLayerId ZedSegSLId(zed->geographicalId().rawId());
122 
123  const LocalPoint posZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localPosition() )) ;
124  const LocalVector dirZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localDirection() )) ;
125 
126  DTRecSegment4D* newSeg = new DTRecSegment4D(*phi,*zed,posZInCh,dirZInCh);
127  //<<
128 
130  theUpdator->update(newSeg);
131  if (debug) cout << "Created a 4D seg " << endl;
132  result.push_back(newSeg);
133  }
134  } else {
135  // Only phi
136  DTRecSegment4D* newSeg = new DTRecSegment4D(*phi);
137  if (debug) cout << "Created a 4D segment using only the 2D Phi segment" << endl;
138  result.push_back(newSeg);
139  }
140  }
141  } else {
142  // DTRecSegment4D from zed projection only (unlikely, not so useful, but...)
143  if (hasZed) {
144  for(vector<DTSLRecSegment2D>::const_iterator zed = theSegments2DTheta.begin();
145  zed != theSegments2DTheta.end(); ++zed){
146 
147  // Important!!
148  DTSuperLayerId ZedSegSLId(zed->geographicalId().rawId());
149 
150  const LocalPoint posZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localPosition() )) ;
151  const LocalVector dirZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localDirection() )) ;
152 
153  DTRecSegment4D* newSeg = new DTRecSegment4D( *zed,posZInCh,dirZInCh);
154  //<<
155 
156  if (debug) cout << "Created a 4D segment using only the 2D Theta segment" << endl;
157  result.push_back(newSeg);
158  }
159  }
160  }
161 
162  return result;
163 }
std::vector< DTSLRecSegment2D > theSegments2DTheta
void update(DTRecSegment4D *seg, const bool calcT0=false) const
recompute hits position and refit the segment4D
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:62
void push_back(D *&d)
Definition: OwnVector.h:273
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:35
tuple result
Definition: query.py:137
std::vector< DTChamberRecSegment2D > refitSuperSegments()
tuple cout
Definition: gather_cfg.py:121
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:67
Definition: DDAxes.h:10
vector< DTChamberRecSegment2D > DTRefitAndCombineReco4D::refitSuperSegments ( )
private

Definition at line 165 of file DTRefitAndCombineReco4D.cc.

References DTRecSegment2D::chi2(), filterCSVwithJSON::copy, DTSegmentUpdator::fit(), query::result, theMaxChi2forPhi, theSegments2DPhi1, theSegments2DPhi2, and theUpdator.

Referenced by reconstruct().

165  {
166  vector<DTChamberRecSegment2D> result;
167 
168  //double-loop over all the DTSLRecSegment2D in order to make all the possible pairs
169  for(vector<DTSLRecSegment2D>::const_iterator segment2DPhi1 = theSegments2DPhi1.begin();
170  segment2DPhi1 != theSegments2DPhi1.end(); ++segment2DPhi1){
171  for(vector<DTSLRecSegment2D>::const_iterator segment2DPhi2 = theSegments2DPhi2.begin();
172  segment2DPhi2 != theSegments2DPhi2.end(); ++segment2DPhi2){
173 
174  // check the id
175  if(segment2DPhi1->chamberId() != segment2DPhi2->chamberId())
176  throw cms::Exception("refitSuperSegments")
177  <<"he phi segments have different chamber id"<<std::endl;
178 
179  // create a super phi starting from 2 phi
180  vector<DTRecHit1D> recHitsSeg2DPhi1 = segment2DPhi1->specificRecHits();
181  vector<DTRecHit1D> recHitsSeg2DPhi2 = segment2DPhi2->specificRecHits();
182  // copy the recHitsSeg2DPhi2 in the recHitsSeg2DPhi1 container
183  copy(recHitsSeg2DPhi2.begin(),recHitsSeg2DPhi2.end(),back_inserter(recHitsSeg2DPhi1));
184 
185  const DTChamberId chId = segment2DPhi1->chamberId();
186 
187  // create the super phi
188  DTChamberRecSegment2D superPhi(chId,recHitsSeg2DPhi1);
189 
190  // refit it!
191  theUpdator->fit(&superPhi);
192 
193  // cut on the chi^2
194  if (superPhi.chi2() > theMaxChi2forPhi)
195  result.push_back(superPhi);
196  }
197  }
198  // TODO clean the container!!!
199  // there are some possible repetition!
200  // maybe using the cleaner, previous a conversion from DTChamberRecSegment2D to DTSegmentCandidate
201  return result;
202 }
tuple result
Definition: query.py:137
bool fit(DTSegmentCand *seg) const
std::vector< DTSLRecSegment2D > theSegments2DPhi1
std::vector< DTSLRecSegment2D > theSegments2DPhi2
void DTRefitAndCombineReco4D::setChamber ( const DTChamberId chId)
virtual

Implements DTRecSegment4DBaseAlgo.

Definition at line 50 of file DTRefitAndCombineReco4D.cc.

References theChamber, and theDTGeometry.

50  {
51  // Set the chamber
52  theChamber = theDTGeometry->chamber(chId);
53 }
edm::ESHandle< DTGeometry > theDTGeometry
virtual void DTRefitAndCombineReco4D::setDTRecHit1DContainer ( edm::Handle< DTRecHitCollection all1DHits)
inlinevirtual

Implements DTRecSegment4DBaseAlgo.

Definition at line 59 of file DTRefitAndCombineReco4D.h.

59 {};
void DTRefitAndCombineReco4D::setDTRecSegment2DContainer ( edm::Handle< DTRecSegment2DCollection all2DSegments)
virtual

Implements DTRecSegment4DBaseAlgo.

Definition at line 56 of file DTRefitAndCombineReco4D.cc.

References gather_cfg::cout, debug, DTSuperLayerId, DTChamber::id(), theChamber, theSegments2DPhi1, theSegments2DPhi2, and theSegments2DTheta.

56  {
57  theSegments2DPhi1.clear();
58  theSegments2DTheta.clear();
59  theSegments2DPhi2.clear();
60 
61  // Get the chamber
62  // const DTChamber *chamber = theDTGeometry->chamber(chId);
63 
64  const DTChamberId chId = theChamber->id();
65 
66  //Extract the DTRecSegment2DCollection ranges for the three different SL
67  DTRecSegment2DCollection::range rangePhi1 = allHits->get(DTSuperLayerId(chId,1));
68  DTRecSegment2DCollection::range rangeTheta = allHits->get(DTSuperLayerId(chId,2));
69  DTRecSegment2DCollection::range rangePhi2 = allHits->get(DTSuperLayerId(chId,3));
70 
71  // Fill the DTSLRecSegment2D containers for the three different SL
72  vector<DTSLRecSegment2D> segments2DPhi1(rangePhi1.first,rangePhi1.second);
73  vector<DTSLRecSegment2D> segments2DTheta(rangeTheta.first,rangeTheta.second);
74  vector<DTSLRecSegment2D> segments2DPhi2(rangePhi2.first,rangePhi2.second);
75 
76  if(debug)
77  cout << "Number of 2D-segments in the first SL (Phi)" << segments2DPhi1.size() << endl
78  << "Number of 2D-segments in the second SL (Theta)" << segments2DTheta.size() << endl
79  << "Number of 2D-segments in the third SL (Phi)" << segments2DPhi2.size() << endl;
80 
81  theSegments2DPhi1 = segments2DPhi1;
82  theSegments2DTheta = segments2DTheta;
83  theSegments2DPhi2 = segments2DPhi2;
84 }
std::vector< DTSLRecSegment2D > theSegments2DTheta
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
DTSuperLayerId
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:35
std::vector< DTSLRecSegment2D > theSegments2DPhi1
std::vector< DTSLRecSegment2D > theSegments2DPhi2
tuple cout
Definition: gather_cfg.py:121
void DTRefitAndCombineReco4D::setES ( const edm::EventSetup setup)
virtual

Implements DTRecSegment4DBaseAlgo.

Definition at line 44 of file DTRefitAndCombineReco4D.cc.

References edm::EventSetup::get(), DTSegmentUpdator::setES(), theDTGeometry, and theUpdator.

44  {
45  setup.get<MuonGeometryRecord>().get(theDTGeometry);
46  theUpdator->setES(setup);
47  // the2DAlgo->setES(setup);
48 }
void setES(const edm::EventSetup &setup)
set the setup
const T & get() const
Definition: EventSetup.h:55
edm::ESHandle< DTGeometry > theDTGeometry
virtual bool DTRefitAndCombineReco4D::wants2DSegments ( )
inlinevirtual

Implements DTRecSegment4DBaseAlgo.

Definition at line 62 of file DTRefitAndCombineReco4D.h.

62 {return true;}

Member Data Documentation

bool DTRefitAndCombineReco4D::debug
private
std::string DTRefitAndCombineReco4D::theAlgoName
private

Definition at line 69 of file DTRefitAndCombineReco4D.h.

Referenced by algoName().

const DTChamber* DTRefitAndCombineReco4D::theChamber
private

Definition at line 85 of file DTRefitAndCombineReco4D.h.

Referenced by reconstruct(), setChamber(), and setDTRecSegment2DContainer().

edm::ESHandle<DTGeometry> DTRefitAndCombineReco4D::theDTGeometry
private

Definition at line 77 of file DTRefitAndCombineReco4D.h.

Referenced by setChamber(), and setES().

double DTRefitAndCombineReco4D::theMaxChi2forPhi
private

Definition at line 71 of file DTRefitAndCombineReco4D.h.

Referenced by DTRefitAndCombineReco4D(), and refitSuperSegments().

std::vector<DTSLRecSegment2D> DTRefitAndCombineReco4D::theSegments2DPhi1
private

Definition at line 86 of file DTRefitAndCombineReco4D.h.

Referenced by refitSuperSegments(), and setDTRecSegment2DContainer().

std::vector<DTSLRecSegment2D> DTRefitAndCombineReco4D::theSegments2DPhi2
private

Definition at line 88 of file DTRefitAndCombineReco4D.h.

Referenced by refitSuperSegments(), and setDTRecSegment2DContainer().

std::vector<DTSLRecSegment2D> DTRefitAndCombineReco4D::theSegments2DTheta
private

Definition at line 87 of file DTRefitAndCombineReco4D.h.

Referenced by reconstruct(), and setDTRecSegment2DContainer().

DTSegmentUpdator* DTRefitAndCombineReco4D::theUpdator
private