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

Date:
2008/10/06 13:41:50
Revision:
1.2
Author
R. Bellan - INFN Torino

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

Date:
2010/09/10 21:44:39
Revision:
1.4
Author

Definition at line 23 of file DirectMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 21 of file DirectMuonTrajectoryBuilder.cc.

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

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

destructor

Definition at line 30 of file DirectMuonTrajectoryBuilder.cc.

References LogTrace, and theSeedTransformer.

30  {
31 
32  LogTrace("Muon|RecoMuon|DirectMuonTrajectoryBuilder")
33  << "DirectMuonTrajectoryBuilder destructor called" << endl;
34 
36 }
#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 138 of file DirectMuonTrajectoryBuilder.cc.

138  {
139 }
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 39 of file DirectMuonTrajectoryBuilder.cc.

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

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

132 {
134 }
MuonCandidate::CandidateContainer CandidateContainer

Member Data Documentation

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

Definition at line 44 of file DirectMuonTrajectoryBuilder.h.

Referenced by trajectories().