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 Attributes
DirectMuonTrajectoryBuilder Class Reference

#include <DirectMuonTrajectoryBuilder.h>

Inheritance diagram for DirectMuonTrajectoryBuilder:
MuonTrajectoryBuilder

Public Member Functions

 DirectMuonTrajectoryBuilder (const edm::ParameterSet &, const MuonServiceProxy *)
 constructor More...
 
virtual void setEvent (const edm::Event &event)
 pass the Event to the algo at each event More...
 
virtual TrajectoryContainer trajectories (const TrajectorySeed &)
 return a container of the reconstructed trajectories compatible with a given seed More...
 
virtual CandidateContainer trajectories (const TrackCand &)
 return a container reconstructed muons starting from a given track More...
 
virtual ~DirectMuonTrajectoryBuilder ()
 destructor More...
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Private Attributes

SeedTransformertheSeedTransformer
 
const MuonServiceProxytheService
 

Additional Inherited Members

- Public Types inherited from MuonTrajectoryBuilder
typedef
MuonCandidate::CandidateContainer 
CandidateContainer
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
typedef
MuonCandidate::TrajectoryContainer 
TrajectoryContainer
 

Detailed Description

Class which takes a trajectory seed and fit its hits, returning a Trajectory container

Author
R. Bellan - INFN Torino

Class which takes a trajectory seed and fit its hits, returning a Trajectory container

Author

Definition at line 21 of file DirectMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

DirectMuonTrajectoryBuilder::DirectMuonTrajectoryBuilder ( const edm::ParameterSet par,
const MuonServiceProxy service 
)

constructor

Definition at line 19 of file DirectMuonTrajectoryBuilder.cc.

References edm::ParameterSet::getParameter(), and theSeedTransformer.

20  :theService(service){
21 
22  // The seed transformer (used to refit the seed and get the seed transient state)
23  // ParameterSet seedTransformerPSet = par.getParameter<ParameterSet>("SeedTransformerParameters");
24  ParameterSet seedTransformerParameters = par.getParameter<ParameterSet>("SeedTransformerParameters");
25  theSeedTransformer = new SeedTransformer(seedTransformerParameters);
26 }
T getParameter(std::string const &) const
DirectMuonTrajectoryBuilder::~DirectMuonTrajectoryBuilder ( )
virtual

destructor

Definition at line 28 of file DirectMuonTrajectoryBuilder.cc.

References LogTrace, and theSeedTransformer.

28  {
29 
30  LogTrace("Muon|RecoMuon|DirectMuonTrajectoryBuilder")
31  << "DirectMuonTrajectoryBuilder destructor called" << endl;
32 
34 }
#define LogTrace(id)

Member Function Documentation

void DirectMuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 136 of file DirectMuonTrajectoryBuilder.cc.

136  {
137 }
MuonTrajectoryBuilder::TrajectoryContainer DirectMuonTrajectoryBuilder::trajectories ( const TrajectorySeed seed)
virtual

return a container of the reconstructed trajectories compatible with a given seed

Implements MuonTrajectoryBuilder.

Definition at line 37 of file DirectMuonTrajectoryBuilder.cc.

References LogTrace, metname, SeedTransformer::seedTransform(), SeedTransformer::setServices(), theSeedTransformer, and theService.

37  {
38 
39  // Set the services for the seed transformer
41 
42  const string metname = "Muon|RecoMuon|DirectMuonTrajectoryBuilder";
43 
45 
46  vector<Trajectory> seedTrajectories = theSeedTransformer->seedTransform(seed);
47 
48  if(!seedTrajectories.empty())
49  for(vector<Trajectory>::const_iterator trajectory = seedTrajectories.begin(); trajectory!=seedTrajectories.end(); ++trajectory)
50  trajectoryContainer.push_back(new Trajectory(*trajectory));
51  else LogTrace(metname) << "Seed not refitted";
52 
53 
54  return trajectoryContainer;
55 
56 
57 // std::pair<bool, Trajectory>
58 // SETFilter::bwfit_SET(const TrajectorySeed &trajectorySeed ,
59 // const TransientTrackingRecHit::ConstRecHitContainer & trajRH,
60 // const TrajectoryStateOnSurface & firstTsos) {
61 // // get the actual fitter - Kalman fit
62 // theService->eventSetup().get<TrajectoryFitter::Record>().get(theBWLightFitterName, theBWLightFitter);
63 // vector<Trajectory> refitted;
64 // Trajectory trajectory;
65 // // the actual Kalman Fit
66 // refitted = theBWLightFitter->fit(trajectorySeed, trajRH, firstTsos);
67 // if(!refitted.empty()){
68 // // under tests...
69 // bool applyPruning = false;
70 // if(applyPruning){
71 // double previousTheta = trajRH[0]->globalPosition().theta();
72 // double previousWeight = 0.;
73 // std::vector <double> weights(trajRH.size());
74 // std::vector <double> weight_diff(trajRH.size());
75 // for(unsigned int iRH = 0; iRH<trajRH.size();++iRH){
76 // double weight = trajRH[iRH]->globalPosition().theta() - previousTheta;
77 // weights.at(iRH)= weight;
78 // double weightDiff = weight + previousWeight;
79 // weight_diff.at(iRH) = weightDiff;
80 // std::cout<<" iRH = "<<iRH<<" globPos"<< trajRH[iRH]->globalPosition()<<" weight = "<<weight<<" weightDiff = "<<weightDiff<<std::endl;
81 // previousTheta = trajRH[iRH]->globalPosition().theta();
82 // previousWeight = weight;
83 
84 // }
85 // Trajectory::DataContainer measurements_segments = refitted.front().measurements();
86 // if(measurements_segments.size() != trajRH.size()){
87 // std::cout<<" measurements_segments.size() = "<<measurements_segments.size()<<
88 // " trajRH.size() = "<<trajRH.size()<<std::endl;
89 // std::cout<<" THIS IS NOT SUPPOSED TO HAPPEN! CHECK THE CODE (pruning)"<<std::endl;
90 // }
91 // std::vector <int> badHits;
92 // TransientTrackingRecHit::ConstRecHitContainer trajRH_pruned;
93 // for(unsigned int iMeas = 0; iMeas<measurements_segments.size();++iMeas){
94 // // we have to apply pruning on the base of intermed. chi2 of measurements
95 // // and then refit again!
96 // std::cout<<" after refitter : iMeas = "<<iMeas<<" estimate() = "<< measurements_segments[iMeas].estimate()<<
97 // " globPos = "<< measurements_segments[iMeas].recHit()->globalPosition()<<std::endl;
98 // //const TransientTrackingRecHit::ConstRecHitContainer trajRH_pruned;
99 // bool pruningCondition = fabs(weights[iMeas])>0.0011 && fabs(weight_diff[iMeas])>0.0011;
100 // std::cout<<" weights[iMeas] = "<<weights[iMeas]<<" weight_diff[iMeas] = "<<weight_diff[iMeas]<<" pruningCondition = "<<pruningCondition<<std::endl;
101 // //bool pruningCondition = (measurements_segments[iMeas].estimate()>50);
102 // if(iMeas && pruningCondition && measurements_segments.size() == trajRH.size()){// first is kept for technical reasons (for now)
103 // badHits.push_back(iMeas);
104 // }
105 // else{
106 // trajRH_pruned.push_back(trajRH[iMeas]);
107 // }
108 // }
109 // if(float(measurements_segments.size())/float(badHits.size()) >0.5 &&
110 // measurements_segments.size() - badHits.size() > 6){
111 // std::cout<<" this is pruning ; badHits.size() = "<<badHits.size()<<std::endl;
112 // refitted = theBWLightFitter->fit(trajectorySeed, trajRH_pruned, firstTsos);
113 // }
114 // }
115 // std::pair<bool, Trajectory> refitResult = make_pair(true,refitted.front());
116 // //return RefitResult(true,refitted.front());
117 // return refitResult;
118 // }
119 // else{
120 // // std::cout<<" refitted.empty() = "<<refitted.empty()<<std::endl;
121 // std::pair<bool, Trajectory> refitResult = make_pair(false,trajectory);
122 // //return RefitResult(false,trajectory);
123 // return refitResult;
124 // }
125 }
const std::string metname
void setServices(const edm::EventSetup &)
Set the services needed by the SeedTransformer.
MuonCandidate::TrajectoryContainer TrajectoryContainer
std::vector< Trajectory > seedTransform(const TrajectorySeed &) const
Performs the fit.
#define LogTrace(id)
MuonTrajectoryBuilder::CandidateContainer DirectMuonTrajectoryBuilder::trajectories ( const TrackCand )
virtual

return a container reconstructed muons starting from a given track

Implements MuonTrajectoryBuilder.

Definition at line 129 of file DirectMuonTrajectoryBuilder.cc.

130 {
132 }
MuonCandidate::CandidateContainer CandidateContainer

Member Data Documentation

SeedTransformer* DirectMuonTrajectoryBuilder::theSeedTransformer
private
const MuonServiceProxy* DirectMuonTrajectoryBuilder::theService
private

Definition at line 42 of file DirectMuonTrajectoryBuilder.h.

Referenced by trajectories().