46 propagator = theService.propagator(
"SmartPropagator");
48 theG = theService.trackingGeometry();
68 std::vector<TrajectoryMeasurement> muonMeasurements = traj.
measurements();
70 for (std::vector<TrajectoryMeasurement>::const_iterator imT = muonMeasurements.begin(); imT != muonMeasurements.end(); imT++ ) {
71 if ( !(*imT).recHit()->isValid() )
continue;
74 result.push_back((*imT).recHit());
75 if (!(*imT).forwardPredictedState().isValid())
continue;
76 if ((*imT).forwardPredictedState().globalPosition().mag()
88 map<int, std::vector<DetId> > detMap;
100 if (bThr <= MAX_THR && bThr >= 0)
DTThr = bThr;
102 if (eThr <= MAX_THR && eThr >= 0)
CSCThr = eThr;
112 for (i=0; i<sz; i++) {
116 bestCSCSeg = segs[
i];
129 for (i=0; i<sz; i++) {
146 std::vector<const DetLayer *> navLayers;
148 unsigned int nlayer = 0;
149 for (
unsigned int ilayer=0; ilayer<navLayers.size(); ilayer++ ) {
153 std::vector<DetLayer::DetWithState> comps = navLayers[ilayer]->compatibleDets(
currentState,
157 if (comps.size() > 0) {
158 DetId id(comps.front().first->geographicalId().rawId());
159 detMap[nlayer].push_back(
id);
162 if (theEstimator)
delete theEstimator;
169 for (
unsigned int iDet = 0; iDet < detMap.size(); ++iDet) {
170 double bestLayerValue =
MAX_THR;
172 std::vector<DetId> chamber = detMap[iDet];
173 for (
unsigned int j = 0;
j < chamber.size(); ++
j) {
179 std::vector<DTRecSegment4D> allDTsegs;
180 std::map<int, std::vector<DTRecSegment4D> >::const_iterator dtIter = getSegs.
getDTlist().find(DTid.
station());
181 if (dtIter != getSegs.
getDTlist().end()){
182 allDTsegs = dtIter->second;
186 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
190 theG->idToDet(allDTsegs[iSeg].chamberId())->surface());
191 if (!tsosdt.
isValid())
continue;
193 std::vector<DTRecSegment4D> DTsegs;
194 DTsegs.push_back(allDTsegs[iSeg]);
197 double bestChamberValue =
getBest(DTsegs, tsosdt, bestDTSeg);
198 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
201 if (bestChamberValue >=
DTThr || bestChamberValue > bestLayerValue)
continue;
203 std::vector<DTRecHit1D> DTrh = getSegs.
getDTRHmap(bestDTSeg);
204 for (std::vector<DTRecHit1D>::iterator it = DTrh.begin(); it != DTrh.end(); it++) {
212 std::vector<CSCSegment> allCSCsegs;
213 std::map<int, std::vector<CSCSegment> >::const_iterator cscIter = getSegs.
getCSClist().find(CSCid.
station());
215 allCSCsegs = cscIter->second;
219 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
223 theG->idToDet(allCSCsegs[iSeg].cscDetId())->surface());
224 if (!tsoscsc.
isValid())
continue;
226 std::vector<CSCSegment> CSCsegs;
227 CSCsegs.push_back(allCSCsegs[iSeg]);
230 double bestChamberValue =
getBest(CSCsegs, tsoscsc, bestCSCSeg);
231 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
234 if (bestChamberValue >=
CSCThr || bestChamberValue > bestLayerValue)
continue;
237 std::vector<CSCRecHit2D> CSCrh = getSegs.
getCSCRHmap(bestCSCSeg);
238 for (std::vector<CSCRecHit2D>::iterator it = CSCrh.begin(); it != CSCrh.end(); ++it) {
245 if (layerRH.size() > 0) {
246 for (ConstRecHitContainer::iterator it = layerRH.begin(); it != layerRH.end(); ++it) {
251 layerRH =
sort(layerRH);
254 DetId id = layerRH.front()->geographicalId();
272 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
273 DTLayerId layid((*it)->det()->geographicalId());
282 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
283 const CSCLayer* cscChamber =
cscGeom->layer((*it)->det()->geographicalId());
297 for(j=n-1; j>=
i; --
j)
299 if(recHits[j-1]->globalPosition().
mag() > recHits[j]->globalPosition().
mag())
301 swap (recHits[j-1],recHits[j]);
void swap(ora::Record &rh, ora::Record &lh)
DirectMuonNavigation * navigation
void compatibleDets(TrajectoryStateOnSurface &, std::map< int, std::vector< DetId > > &)
TrajectoryStateOnSurface currentState
edm::ESHandle< Propagator > propagatorCompatibleDet
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint globalPosition() const
ConstRecHitPointer recHit() const
std::vector< CSCRecHit2D > getCSCRHmap(CSCSegment)
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
DataContainer const & measurements() const
void filteringAlgo(std::map< int, std::vector< DetId > > &)
std::vector< DTRecHit1D > getDTRHmap(DTRecSegment4D)
edm::ESHandle< MuonDetLayerGeometry > navMuon
const std::map< int, std::vector< CSCSegment > > & getCSClist() const
ConstRecHitContainer result
FreeTrajectoryState * freeState(bool withErrors=true) const
const edm::EventSetup * theSetup
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
double getBest(std::vector< CSCSegment > &, TrajectoryStateOnSurface &, CSCSegment &)
DetId geographicalId() const
The label of this GeomDet.
edm::ESHandle< TrajectoryStateUpdator > updatorHandle
TransientTrackingRecHit::ConstRecHitContainer filter(const Trajectory &)
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
tuple Chi2MeasurementEstimator
const edm::Event * theEvent
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
std::vector< ConstRecHitPointer > ConstRecHitContainer
DynamicTruncation(const edm::Event &, const MuonServiceProxy &)
void update(TrajectoryStateOnSurface &, ConstRecHitPointer)
ConstRecHitContainer sort(ConstRecHitContainer &)
edm::ESHandle< Propagator > propagator
std::vector< std::vector< double > > tmp
const std::map< int, std::vector< DTRecSegment4D > > & getDTlist() const
void updateWithDThits(ConstRecHitContainer &)
void updateWithCSChits(ConstRecHitContainer &)
DetId geographicalId() const
int station() const
Return the station number.
Detector det() const
get the detector field from this detid
edm::ESHandle< MagneticField > magfield
edm::ESHandle< GlobalTrackingGeometry > theG
edm::ESHandle< CSCGeometry > cscGeom