CMS 3D CMS Logo

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...
 
void setEvent (const edm::Event &event) override
 pass the Event to the algo at each event More...
 
CandidateContainer trajectories (const TrackCand &) override
 return a container reconstructed muons starting from a given track More...
 
TrajectoryContainer trajectories (const TrajectorySeed &) override
 return a container of the reconstructed trajectories compatible with a given seed More...
 
 ~DirectMuonTrajectoryBuilder () override
 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::TrackRefTrackCand
 
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 23 of file DirectMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ DirectMuonTrajectoryBuilder()

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

constructor

Definition at line 18 of file DirectMuonTrajectoryBuilder.cc.

19  : theService(service) {
20  // The seed transformer (used to refit the seed and get the seed transient state)
21  // ParameterSet seedTransformerPSet = par.getParameter<ParameterSet>("SeedTransformerParameters");
22  ParameterSet seedTransformerParameters = par.getParameter<ParameterSet>("SeedTransformerParameters");
23  theSeedTransformer = new SeedTransformer(seedTransformerParameters);
24 }

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

◆ ~DirectMuonTrajectoryBuilder()

DirectMuonTrajectoryBuilder::~DirectMuonTrajectoryBuilder ( )
override

destructor

Definition at line 26 of file DirectMuonTrajectoryBuilder.cc.

26  {
27  LogTrace("Muon|RecoMuon|DirectMuonTrajectoryBuilder") << "DirectMuonTrajectoryBuilder destructor called" << endl;
28 
30  delete theSeedTransformer;
31 }

References LogTrace, and theSeedTransformer.

Member Function Documentation

◆ setEvent()

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

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 126 of file DirectMuonTrajectoryBuilder.cc.

126 {}

◆ trajectories() [1/2]

MuonTrajectoryBuilder::CandidateContainer DirectMuonTrajectoryBuilder::trajectories ( const TrackCand )
overridevirtual

return a container reconstructed muons starting from a given track

Implements MuonTrajectoryBuilder.

Definition at line 122 of file DirectMuonTrajectoryBuilder.cc.

122  {
124 }

◆ trajectories() [2/2]

MuonTrajectoryBuilder::TrajectoryContainer DirectMuonTrajectoryBuilder::trajectories ( const TrajectorySeed seed)
overridevirtual

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

Implements MuonTrajectoryBuilder.

Definition at line 33 of file DirectMuonTrajectoryBuilder.cc.

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

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

Member Data Documentation

◆ theSeedTransformer

SeedTransformer* DirectMuonTrajectoryBuilder::theSeedTransformer
private

◆ theService

const MuonServiceProxy* DirectMuonTrajectoryBuilder::theService
private

Definition at line 41 of file DirectMuonTrajectoryBuilder.h.

Referenced by trajectories().

service
Definition: service.py:1
SeedTransformer
Definition: SeedTransformer.h:29
DirectMuonTrajectoryBuilder::theService
const MuonServiceProxy * theService
Definition: DirectMuonTrajectoryBuilder.h:41
SeedTransformer::seedTransform
std::vector< Trajectory > seedTransform(const TrajectorySeed &) const
Performs the fit.
Definition: SeedTransformer.cc:70
MuonTrajectoryBuilder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrajectoryBuilder.h:24
DirectMuonTrajectoryBuilder::theSeedTransformer
SeedTransformer * theSeedTransformer
Definition: DirectMuonTrajectoryBuilder.h:42
fileCollector.seed
seed
Definition: fileCollector.py:127
edm::ParameterSet
Definition: ParameterSet.h:47
MuonTrajectoryBuilder::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrajectoryBuilder.h:23
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SeedTransformer::setServices
void setServices(const edm::EventSetup &)
Set the services needed by the SeedTransformer.
Definition: SeedTransformer.cc:62
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40