44 LogTrace(metname) <<
"constructor called" << endl;
56 string seedPosition = par.
getParameter<
string>(
"SeedPosition");
62 <<
"Wrong seed position chosen in StandAloneMuonFilter::StandAloneMuonFilter ParameterSet"
64 <<
"Possible choices are:"
66 <<
"SeedPosition = in or SeedPosition = out";
110 LogTrace(
"Muon|RecoMuon|StandAloneMuonTrajectoryBuilder")
111 <<
"StandAloneMuonTrajectoryBuilder destructor called" << endl;
124 ~Resetter() {
if(mf) mf->reset();}
130 Resetter fwReset(
filter());
149 vector<Trajectory> seedTrajectories;
153 if(!seedTrajectories.empty()) {
155 lastTSOS = lastTM.updatedState();
156 lastDetId = lastTM.recHit()->geographicalId();
165 LogTrace(metname) <<
"Trajectory State on Surface before the extrapolation"<<endl;
169 LogTrace(metname) <<
"The RecSegment relies on: "<<endl;
177 filter()->
refit(inputFromSeed.second,inputFromSeed.first,trajectoryFW);
180 if( trajectoryFW.
empty() ) {
181 LogTrace(metname) <<
"Forward trajectory EMPTY! No trajectory will be loaded!" << endl;
182 return trajectoryContainer;
189 LogTrace(metname) <<
"StandAloneMuonTrajectoryBuilder filter output " << endl;
214 if(
filter()->goodState() ) {
217 else if(
filter()->isCompatibilitySatisfied() ) {
218 int foundValidRh = trajectoryFW.
foundHits();
219 LogTrace(metname) <<
"Compatibility satisfied after Forward filter, but too few valid RecHits ("
220 << foundValidRh <<
")." << endl
221 <<
"A trajectory with only invalid RecHits will be loaded!" << endl;
223 trajectoryContainer.push_back(
new Trajectory(trajectoryFW));
224 return trajectoryContainer;
228 trajectoryContainer.push_back(
new Trajectory(defaultTraj));
229 return trajectoryContainer;
232 LogTrace(metname) <<
"Compatibility NOT satisfied after Forward filter! No trajectory will be loaded!" << endl;
236 return trajectoryContainer;
240 LogTrace(metname) <<
"Number of DT/CSC/RPC chamber used (fw): "
248 LogTrace(metname) <<
"Only forward refit requested. No backward refit will be performed!"<<endl;
253 pair<bool,Trajectory> refitResult =
refitter()->
refit(trajectoryFW);
254 if(refitResult.first) {
255 trajectoryContainer.push_back(
new Trajectory(refitResult.second));
256 LogTrace(metname) <<
"StandAloneMuonTrajectoryBuilder refit output " << endl ;
257 LogTrace(metname) << debug.
dumpTSOS(refitResult.second.lastMeasurement().updatedState());
260 trajectoryContainer.push_back(
new Trajectory(trajectoryFW));
263 trajectoryContainer.push_back(
new Trajectory(trajectoryFW));
265 LogTrace(metname) <<
"Trajectory saved" << endl;
266 return trajectoryContainer;
276 seedForBW = seedVoid;
295 LogWarning(metname) <<
"Wrong seed type for the backward filter!";
298 Trajectory trajectoryBW(seedForBW,bwDirection);
306 LogTrace(metname) <<
"StandAloneMuonTrajectoryBuilder BW filter output " << endl ;
310 <<
"Number of RecHits: " << trajectoryBW.
foundHits() <<
"\n"
311 <<
"Number of DT/CSC/RPC chamber used (bw): "
367 else if(
bwfilter()->isCompatibilitySatisfied() ) {
368 LogTrace(metname) <<
"Compatibility satisfied after Backward filter, but too few valid RecHits ("
369 << trajectoryBW.
foundHits() <<
")." << endl
370 <<
"The (good) result of FW filter will be loaded!" << endl;
371 trajectoryContainer.push_back(
new Trajectory(trajectoryFW));
372 return trajectoryContainer;
375 LogTrace(metname) <<
"Compatibility NOT satisfied after Backward filter!" << endl
376 <<
"The Forward trajectory will be invalidated and then loaded!" << endl;
379 trajectoryContainer.push_back(
new Trajectory(defaultTraj));
380 return trajectoryContainer;
385 pair<bool,Trajectory> refitResult =
refitter()->
refit(trajectoryBW);
386 if(refitResult.first) {
387 trajectoryContainer.push_back(
new Trajectory(refitResult.second));
388 LogTrace(metname) <<
"StandAloneMuonTrajectoryBuilder Refit output " << endl;
389 LogTrace(metname) << debug.
dumpTSOS(refitResult.second.lastMeasurement().updatedState());
392 trajectoryContainer.push_back(
new Trajectory(trajectoryBW));
395 trajectoryContainer.push_back(
new Trajectory(trajectoryBW));
397 LogTrace(metname) <<
"Trajectory saved" << endl;
399 return trajectoryContainer;
409 DetId seedDetId(aDetId);
416 LogTrace(metname)<<
"Seed's id: "<< endl ;
420 const DetLayer *initialLayer =
theService->detLayerGeometry()->idToLayer( seedDetId );
422 LogTrace(metname)<<
"Seed's detLayer: "<< endl ;
425 LogTrace(metname)<<
"TrajectoryStateOnSurface before propagation:" << endl;
432 vector<const DetLayer*> detLayers;
435 detLayers =
theService->muonNavigationSchool()->compatibleLayers(*initialLayer, *initialState.
freeState(),detLayerOrder);
441 edm::LogError(metname) <<
"No Properly Navigation Selected!!"<<endl;
444 LogTrace(metname) <<
"There are "<< detLayers.size() <<
" compatible layers"<<endl;
448 if(detLayers.size()){
450 LogTrace(metname) <<
"Compatible layers:"<<endl;
451 for( vector<const DetLayer*>::const_iterator layer = detLayers.begin();
452 layer != detLayers.end(); layer++){
453 LogTrace(metname) << debug.
dumpMuonId((*layer)->basicComponents().front()->geographicalId());
457 const DetLayer* finalLayer = detLayers.back();
460 else LogTrace(metname) <<
"Most external one:"<<endl;
471 LogTrace(metname) <<
"Trajectory State on Surface after the extrapolation"<<endl;
476 LogTrace(metname)<<
"Extrapolation failed. Keep the original seed state" <<endl;
479 LogTrace(metname)<<
"No compatible layers. Keep the original seed state" <<endl;
bool empty() const
True if trajectory has no measurements.
T getParameter(std::string const &) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
ConstRecHitPointer const & recHit() const
SeedTransformer * theSeedTransformer
void createDefaultTrajectory(const Trajectory &, Trajectory &)
std::string dumpLayer(const DetLayer *layer) const
recoMuon::SeedPosition theSeedPosition
StandAloneMuonTrajectoryBuilder(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &iC)
Constructor with Parameter set and MuonServiceProxy.
const std::string metname
StandAloneMuonFilter * theFilter
int getRPCChamberUsed() const
MuonCandidate::TrajectoryContainer TrajectoryContainer
std::string theBWSeedType
int getRPCCompatibleChambers() const
TrajectoryStateOnSurface lastUpdatedTSOS() const
the Trajectory state on the last surface of the fitting
void refit(const TrajectoryStateOnSurface &initialState, const DetLayer *, Trajectory &trajectory)
Perform the inner-outward fitting.
int getDTChamberUsed() const
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
std::string dumpMuonId(const DetId &id) const
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
int getCSCCompatibleChambers() const
int getDTCompatibleChambers() const
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
StandAloneMuonFilter * theBWFilter
TrajectoryMeasurement const & lastMeasurement() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
void addParameter(std::string const &name, T const &value)
StandAloneMuonFilter * bwfilter() const
actual filter
unsigned int detId() const
RefitResult refit(const Trajectory &)
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
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
GlobalVector momentum() const
std::string theNavigationType
std::pair< const DetLayer *, TrajectoryStateOnSurface > DetLayerWithState
PTrajectoryStateOnDet const & startingState() const
int getCSCChamberUsed() const
StandAloneMuonFilter * filter() const
pre-filter
TrajectoryContainer trajectories(const TrajectorySeed &)
return a container of the reconstructed trajectories compatible with a given seed ...
const MuonServiceProxy * theService
int getTotalCompatibleChambers() const
std::string theSeedPropagatorName
Propagator for the seed extrapolation.
virtual ~StandAloneMuonTrajectoryBuilder()
Destructor.
StandAloneMuonRefitter * theRefitter
StandAloneMuonRefitter * refitter() const
refitter of the hits container
TrajectoryStateOnSurface lastCompatibleTSOS() const
the Trajectory state on the last compatible surface
DetLayerWithState propagateTheSeedTSOS(TrajectoryStateOnSurface &aTSOS, DetId &aDetId)