#include <MuonTrackingRegionBuilder.h>
Build a TrackingRegion around a standalone muon
Definition at line 30 of file MuonTrackingRegionBuilder.h.
MuonTrackingRegionBuilder::MuonTrackingRegionBuilder | ( | const edm::ParameterSet & | par | ) |
constructor
Definition at line 43 of file MuonTrackingRegionBuilder.cc.
References newFWLiteAna::build.
{ build(par); }
MuonTrackingRegionBuilder::MuonTrackingRegionBuilder | ( | const edm::ParameterSet & | par, |
const MuonServiceProxy * | service | ||
) | [inline] |
virtual MuonTrackingRegionBuilder::~MuonTrackingRegionBuilder | ( | ) | [inline, virtual] |
void MuonTrackingRegionBuilder::build | ( | const edm::ParameterSet & | par | ) | [private] |
Definition at line 47 of file MuonTrackingRegionBuilder.cc.
References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by MuonTrackingRegionBuilder().
{ // vertex Collection and Beam Spot theBeamSpotTag = par.getParameter<edm::InputTag>("beamSpot"); theVertexCollTag = par.getParameter<edm::InputTag>("vertexCollection"); // parmeters theNsigmaEta = par.getParameter<double>("Rescale_eta"); theNsigmaPhi = par.getParameter<double>("Rescale_phi"); theNsigmaDz = par.getParameter<double>("Rescale_Dz"); theTkEscapePt = par.getParameter<double>("EscapePt"); // upper limits parameters theEtaRegionPar1 = par.getParameter<double>("EtaR_UpperLimit_Par1"); theEtaRegionPar2 = par.getParameter<double>("EtaR_UpperLimit_Par2"); thePhiRegionPar1 = par.getParameter<double>("PhiR_UpperLimit_Par1"); thePhiRegionPar2 = par.getParameter<double>("PhiR_UpperLimit_Par2"); useVertex = par.getParameter<bool>("UseVertex"); useFixedRegion = par.getParameter<bool>("UseFixedRegion"); // fixed limits thePhiFixed = par.getParameter<double>("Phi_fixed"); theEtaFixed = par.getParameter<double>("Eta_fixed"); thePhiMin = par.getParameter<double>("Phi_min"); theEtaMin = par.getParameter<double>("Eta_min"); theHalfZ = par.getParameter<double>("DeltaZ_Region"); theDeltaR = par.getParameter<double>("DeltaR"); // perigee reference point theOnDemand = par.getParameter<double>("OnDemand"); theMeasurementTrackerName = par.getParameter<std::string>("MeasurementTrackerName"); }
void MuonTrackingRegionBuilder::init | ( | const MuonServiceProxy * | service | ) |
Definition at line 42 of file MuonTrackingRegionBuilder.cc.
Referenced by TSGFromL2Muon::beginRun(), MuonTrackingRegionBuilder(), and HIMuonTrackingRegionProducer::regions().
{ theService= service;}
RectangularEtaPhiTrackingRegion * MuonTrackingRegionBuilder::region | ( | const reco::TrackRef & | track | ) | const |
define tracking region
Definition at line 87 of file MuonTrackingRegionBuilder.cc.
Referenced by GlobalTrajectoryBuilderBase::defineRegionOfInterest(), TSGFromL2Muon::produce(), FastTSGFromL2Muon::produce(), and HIMuonTrackingRegionProducer::regions().
{ return region(*track); }
RectangularEtaPhiTrackingRegion * MuonTrackingRegionBuilder::region | ( | const reco::Track & | staTrack | ) | const |
define tracking region
Definition at line 108 of file MuonTrackingRegionBuilder.cc.
References deltaR(), eta, PerigeeConversions::ftsToPerigeeError(), trajectoryStateTransform::initialFreeState(), reco::Track::innerMomentum(), TrajectoryStateClosestToBeamLine::isValid(), LogDebug, max(), min, gsfElectronCkfTrackCandidateMaker_cff::minPt, FreeTrajectoryState::momentum(), reco::TrackBase::p(), phi, PerigeeTrajectoryError::phiError(), funct::sin(), theta(), PerigeeTrajectoryError::thetaError(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), GoodVertex_cfg::vertexCollection, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().
{ // get the free trajectory state of the muon updated at vertex TSCPBuilderNoMaterial tscpBuilder; FreeTrajectoryState muFTS = trajectoryStateTransform::initialFreeState(staTrack,&*theService->magneticField()); LogDebug("MuonTrackingRegionBuilder")<<"from state: "<<muFTS; // get track direction at vertex GlobalVector dirVector(muFTS.momentum()); // get track momentum const math::XYZVector& mo = staTrack.innerMomentum(); GlobalVector mom(mo.x(),mo.y(),mo.z()); if ( staTrack.p() > 1.5 ) { mom = dirVector; } // initial vertex position - in the following it is replaced with beam spot/vertexing GlobalPoint vertexPos(0.0,0.0,0.0); double deltaZatVTX = 0.0; // retrieve beam spot information edm::Handle<reco::BeamSpot> bsHandle; bool bsHandleFlag = theEvent->getByLabel(theBeamSpotTag, bsHandle); // check the validity, otherwise vertexing // inizialization of BS if ( bsHandleFlag && !useVertex ) { const reco::BeamSpot& bs = *bsHandle; vertexPos = GlobalPoint(bs.x0(), bs.y0(), bs.z0()); } else { // get originZPos from list of reconstructed vertices (first or all) edm::Handle<reco::VertexCollection> vertexCollection; bool vtxHandleFlag = theEvent->getByLabel(theVertexCollTag,vertexCollection); // check if there exists at least one reconstructed vertex if ( vtxHandleFlag && !vertexCollection->empty() ) { // use the first vertex in the collection and assume it is the primary event vertex reco::VertexCollection::const_iterator vtx = vertexCollection->begin(); vertexPos = GlobalPoint(vtx->x(),vtx->y(),vtx->z()); // delta Z from vertex error deltaZatVTX = vtx->zError() * theNsigmaDz; } } // inizialize to the maximum possible value to avoit // problems with TSCBL double deta = 0.4; double dphi = 0.6; // take into account the correct beanspot rotation if ( bsHandleFlag ) { const reco::BeamSpot& bs = *bsHandle; TSCBLBuilderNoMaterial tscblBuilder; TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(muFTS,bs); // evaluate the dynamical region if possible if(tscbl.isValid()){ PerigeeTrajectoryError trackPerigeeErrors = PerigeeConversions::ftsToPerigeeError(tscbl.trackStateAtPCA()); GlobalVector pTrack = tscbl.trackStateAtPCA().momentum(); // calculate deltaEta from deltaTheta double deltaTheta = trackPerigeeErrors.thetaError(); double theta = pTrack.theta(); double sin_theta = sin(theta); // get dEta and dPhi deta = theNsigmaEta*(1/fabs(sin_theta))*deltaTheta; dphi = theNsigmaPhi*(trackPerigeeErrors.phiError()); } } /* Region_Parametrizations to take into account possible L2 error matrix inconsistencies. Detailed Explanation in TWIKI page. */ double region_dEta = 0; double region_dPhi = 0; double eta=0; double phi=0; // eta, pt parametrization from MC study float pt = fabs(mom.perp()); if ( pt <= 10. ) { // angular coefficients float acoeff_Phi = (thePhiRegionPar2 - thePhiRegionPar1)/5; float acoeff_Eta = (theEtaRegionPar2 - theEtaRegionPar1)/5; eta = theEtaRegionPar1 + (acoeff_Eta)*(mom.perp()-5.); phi = thePhiRegionPar1 + (acoeff_Phi)*(mom.perp()-5.) ; } // parametrization 2nd bin in pt from MC study if ( pt > 10. && pt < 100. ) { eta = theEtaRegionPar2; phi = thePhiRegionPar2; } // parametrization 3rd bin in pt from MC study if ( pt >= 100. ) { // angular coefficients float acoeff_Phi = (thePhiRegionPar1 - thePhiRegionPar2)/900; float acoeff_Eta = (theEtaRegionPar1 - theEtaRegionPar2)/900; eta = theEtaRegionPar2 + (acoeff_Eta)*(mom.perp()-100.); phi = thePhiRegionPar2 + (acoeff_Phi)*(mom.perp()-100.); } // decide to use either a parametrization or a dynamical region double region_dPhi1 = min(phi,dphi); double region_dEta1 = min(eta,deta); // minimum size region_dPhi = max(thePhiMin,region_dPhi1); region_dEta = max(theEtaMin,region_dEta1); float deltaZ = 0.0; // standard 15.9 is useVertex than region from vertexing if ( useVertex ) { deltaZ = max(theHalfZ,deltaZatVTX); } else { deltaZ = theHalfZ; } float deltaR = theDeltaR; double minPt = max(theTkEscapePt,mom.perp()*0.6); RectangularEtaPhiTrackingRegion* region = 0; if (useFixedRegion) { region_dEta = theEtaFixed; region_dPhi = thePhiFixed; } region = new RectangularEtaPhiTrackingRegion(dirVector, vertexPos, minPt, deltaR, deltaZ, region_dEta, region_dPhi, theOnDemand, true,/*default in the header*/ theMeasurementTrackerName); LogDebug("MuonTrackingRegionBuilder")<<"the region parameters are:\n" <<"\n dirVector: "<<dirVector <<"\n vertexPos: "<<vertexPos <<"\n minPt: "<<minPt <<"\n deltaR:"<<deltaR <<"\n deltaZ:"<<deltaZ <<"\n region_dEta:"<<region_dEta <<"\n region_dPhi:"<<region_dPhi <<"\n on demand parameter: "<<theOnDemand; return region; }
void MuonTrackingRegionBuilder::setEvent | ( | const edm::Event & | event | ) | [virtual] |
pass the Event to the algo at each event
Definition at line 97 of file MuonTrackingRegionBuilder.cc.
References event().
Referenced by TSGFromL2Muon::produce(), FastTSGFromL2Muon::produce(), HIMuonTrackingRegionProducer::regions(), and GlobalTrajectoryBuilderBase::setEvent().
Definition at line 55 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theDeltaR [private] |
Definition at line 74 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theEtaFixed [private] |
Definition at line 75 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theEtaMin [private] |
Definition at line 73 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theEtaRegionPar1 [private] |
Definition at line 67 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theEtaRegionPar2 [private] |
Definition at line 68 of file MuonTrackingRegionBuilder.h.
const edm::Event* MuonTrackingRegionBuilder::theEvent [private] |
Definition at line 58 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theHalfZ [private] |
Definition at line 74 of file MuonTrackingRegionBuilder.h.
std::string MuonTrackingRegionBuilder::theMeasurementTrackerName [private] |
Definition at line 80 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theNsigmaDz [private] |
Definition at line 65 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theNsigmaEta [private] |
Definition at line 65 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theNsigmaPhi [private] |
Definition at line 65 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theOnDemand [private] |
Definition at line 79 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::thePhiFixed [private] |
Definition at line 75 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::thePhiMin [private] |
Definition at line 72 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::thePhiRegionPar1 [private] |
Definition at line 69 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::thePhiRegionPar2 [private] |
Definition at line 70 of file MuonTrackingRegionBuilder.h.
const MuonServiceProxy* MuonTrackingRegionBuilder::theService [private] |
Definition at line 59 of file MuonTrackingRegionBuilder.h.
double MuonTrackingRegionBuilder::theTkEscapePt [private] |
Definition at line 64 of file MuonTrackingRegionBuilder.h.
Definition at line 56 of file MuonTrackingRegionBuilder.h.
Definition at line 77 of file MuonTrackingRegionBuilder.h.
bool MuonTrackingRegionBuilder::useFixedRegion [private] |
Definition at line 61 of file MuonTrackingRegionBuilder.h.
bool MuonTrackingRegionBuilder::useVertex [private] |
Definition at line 62 of file MuonTrackingRegionBuilder.h.