57 propagator = theService.propagator(
"SmartPropagator");
59 theG = theService.trackingGeometry();
83 for ( std::vector<AlignTransformError>::const_iterator it = dtAlignmentErrors->m_alignError.begin();
84 it != dtAlignmentErrors->m_alignError.end(); it++ ) {
85 CLHEP::HepSymMatrix
error = (*it).matrix();
86 GlobalError glbErr(error[0][0], error[1][0], error[1][1], error[2][0], error[2][1], error[2][2]);
88 dtApeMap.insert( pair<DTChamberId, GlobalError> (DTid, glbErr) );
95 for ( std::vector<AlignTransformError>::const_iterator it = cscAlignmentErrors->m_alignError.begin();
96 it != cscAlignmentErrors->m_alignError.end(); it++ ) {
97 CLHEP::HepSymMatrix
error = (*it).matrix();
98 GlobalError glbErr(error[0][0], error[1][0], error[1][1], error[2][0], error[2][1], error[2][2]);
100 cscApeMap.insert( pair<CSCDetId, GlobalError> (CSCid, glbErr) );
104 std::vector<TrajectoryMeasurement> muonMeasurements = traj.
measurements();
106 for (std::vector<TrajectoryMeasurement>::const_iterator imT = muonMeasurements.begin(); imT != muonMeasurements.end(); imT++ ) {
107 if ( !(*imT).recHit()->isValid() )
continue;
110 result.push_back((*imT).recHit());
111 if (!(*imT).forwardPredictedState().isValid())
continue;
112 if ((*imT).forwardPredictedState().globalPosition().mag()
124 map<int, std::vector<DetId> > detMap;
136 if (bThr <= MAX_THR && bThr >= 0)
DTThr = bThr;
138 if (eThr <= MAX_THR && eThr >= 0)
CSCThr = eThr;
148 for (i=0; i<sz; i++) {
154 bestCSCSeg = segs[
i];
167 for (i=0; i<sz; i++) {
186 std::vector<const DetLayer *> navLayers;
188 for (
unsigned int ilayer=0; ilayer<navLayers.size(); ilayer++ ) {
192 std::vector<DetLayer::DetWithState> comps = navLayers[ilayer]->compatibleDets(
currentState,
196 if (comps.size() > 0) {
197 for (
unsigned int icomp=0; icomp<comps.size(); icomp++ ) {
199 detMap[ilayer].push_back(
id);
203 if (theEstimator)
delete theEstimator;
210 for (
unsigned int iDet = 0; iDet < detMap.size(); ++iDet) {
211 double bestLayerValue =
MAX_THR;
212 bool isDTorCSC =
false;
214 std::vector<DetId> chamber = detMap[iDet];
215 for (
unsigned int j = 0;
j < chamber.size(); ++
j) {
223 std::vector<DTRecSegment4D> allDTsegs;
224 std::map<int, std::vector<DTRecSegment4D> >::const_iterator dtIter = getSegs.
getDTlist().find(DTid.
station());
225 if (dtIter != getSegs.
getDTlist().end()){
226 allDTsegs = dtIter->second;
229 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
233 theG->idToDet(allDTsegs[iSeg].chamberId())->surface());
234 if (!tsosdt.
isValid())
continue;
236 std::vector<DTRecSegment4D> DTsegs;
237 DTsegs.push_back(allDTsegs[iSeg]);
240 double bestChamberValue =
getBest(DTsegs, tsosdt, bestDTSeg);
241 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
244 if (bestChamberValue >=
DTThr || bestChamberValue > bestLayerValue)
continue;
246 std::vector<DTRecHit1D> DTrh = getSegs.
getDTRHmap(bestDTSeg);
247 for (std::vector<DTRecHit1D>::iterator it = DTrh.begin(); it != DTrh.end(); it++) {
256 std::vector<CSCSegment> allCSCsegs;
257 std::map<int, std::vector<CSCSegment> >::const_iterator cscIter = getSegs.
getCSClist().find(CSCid.
station());
259 allCSCsegs = cscIter->second;
263 for (
unsigned int iSeg=0; iSeg<sz; ++iSeg) {
267 theG->idToDet(allCSCsegs[iSeg].cscDetId())->surface());
268 if (!tsoscsc.
isValid())
continue;
270 std::vector<CSCSegment> CSCsegs;
271 CSCsegs.push_back(allCSCsegs[iSeg]);
274 double bestChamberValue =
getBest(CSCsegs, tsoscsc, bestCSCSeg);
275 if (bestChamberValue < bestLayerValue) bestLayerValue = bestChamberValue;
278 if (bestChamberValue >=
CSCThr || bestChamberValue > bestLayerValue)
continue;
280 std::vector<CSCRecHit2D> CSCrh = getSegs.
getCSCRHmap(bestCSCSeg);
281 for (std::vector<CSCRecHit2D>::iterator it = CSCrh.begin(); it != CSCrh.end(); ++it) {
293 if (layerRH.size() > 0) {
294 for (ConstRecHitContainer::iterator it = layerRH.begin(); it != layerRH.end(); ++it) {
299 layerRH =
sort(layerRH);
302 DetId id = layerRH.front()->geographicalId();
320 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
321 DTLayerId layid((*it)->det()->geographicalId());
330 for (ConstRecHitContainer::const_iterator it = recHits.begin(); it != recHits.end(); ++it) {
331 const CSCLayer* cscChamber =
cscGeom->layer((*it)->det()->geographicalId());
345 for(j=n-1; j>=
i; --
j)
347 if(recHits[j-1]->globalPosition().
mag() > recHits[j]->globalPosition().
mag())
349 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
std::vector< double > estimators
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
U second(std::pair< T, U > const &p)
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
std::map< DTChamberId, GlobalError > dtApeMap
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
std::map< CSCDetId, GlobalError > cscApeMap
edm::ESHandle< GlobalTrackingGeometry > theG
edm::ESHandle< CSCGeometry > cscGeom