CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonTrackingRegionBuilder Class Reference

#include <MuonTrackingRegionBuilder.h>

Public Member Functions

void init (const MuonServiceProxy *)
 
 MuonTrackingRegionBuilder (const edm::ParameterSet &)
 constructor More...
 
 MuonTrackingRegionBuilder (const edm::ParameterSet &par, const MuonServiceProxy *service)
 
RectangularEtaPhiTrackingRegionregion (const reco::TrackRef &) const
 define tracking region More...
 
RectangularEtaPhiTrackingRegionregion (const reco::Track &) const
 define tracking region More...
 
virtual void setEvent (const edm::Event &)
 pass the Event to the algo at each event More...
 
virtual ~MuonTrackingRegionBuilder ()
 destructor More...
 

Private Member Functions

void build (const edm::ParameterSet &)
 

Private Attributes

edm::InputTag theBeamSpotTag
 
double theDeltaR
 
double theEtaFixed
 
double theEtaMin
 
double theEtaRegionPar1
 
double theEtaRegionPar2
 
const edm::EventtheEvent
 
double theHalfZ
 
std::string theMeasurementTrackerName
 
double theNsigmaDz
 
double theNsigmaEta
 
double theNsigmaPhi
 
double theOnDemand
 
double thePhiFixed
 
double thePhiMin
 
double thePhiRegionPar1
 
double thePhiRegionPar2
 
const MuonServiceProxytheService
 
double theTkEscapePt
 
edm::InputTag theVertexCollTag
 
GlobalPoint theVertexPos
 
bool useFixedRegion
 
bool useVertex
 

Detailed Description

Build a TrackingRegion around a standalone muon

Author
A. Everett - Purdue University
A. Grelli - Purdue University, Pavia University

Definition at line 28 of file MuonTrackingRegionBuilder.h.

Constructor & Destructor Documentation

MuonTrackingRegionBuilder::MuonTrackingRegionBuilder ( const edm::ParameterSet par)

constructor

Definition at line 41 of file MuonTrackingRegionBuilder.cc.

References newFWLiteAna::build.

42 {
43  build(par);
44 }
void build(const edm::ParameterSet &)
MuonTrackingRegionBuilder::MuonTrackingRegionBuilder ( const edm::ParameterSet par,
const MuonServiceProxy service 
)
inline

Definition at line 34 of file MuonTrackingRegionBuilder.h.

References build(), and init().

35  { build(par);init(service);}
void build(const edm::ParameterSet &)
void init(const MuonServiceProxy *)
virtual MuonTrackingRegionBuilder::~MuonTrackingRegionBuilder ( )
inlinevirtual

destructor

Definition at line 39 of file MuonTrackingRegionBuilder.h.

39 {}

Member Function Documentation

void MuonTrackingRegionBuilder::build ( const edm::ParameterSet par)
private

Definition at line 45 of file MuonTrackingRegionBuilder.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MuonTrackingRegionBuilder().

45  {
46  // vertex Collection and Beam Spot
47  theBeamSpotTag = par.getParameter<edm::InputTag>("beamSpot");
48  theVertexCollTag = par.getParameter<edm::InputTag>("vertexCollection");
49 
50  // parmeters
51  theNsigmaEta = par.getParameter<double>("Rescale_eta");
52  theNsigmaPhi = par.getParameter<double>("Rescale_phi");
53  theNsigmaDz = par.getParameter<double>("Rescale_Dz");
54  theTkEscapePt = par.getParameter<double>("EscapePt");
55 
56  // upper limits parameters
57  theEtaRegionPar1 = par.getParameter<double>("EtaR_UpperLimit_Par1");
58  theEtaRegionPar2 = par.getParameter<double>("EtaR_UpperLimit_Par2");
59  thePhiRegionPar1 = par.getParameter<double>("PhiR_UpperLimit_Par1");
60  thePhiRegionPar2 = par.getParameter<double>("PhiR_UpperLimit_Par2");
61 
62  useVertex = par.getParameter<bool>("UseVertex");
63  useFixedRegion = par.getParameter<bool>("UseFixedRegion");
64 
65  // fixed limits
66  thePhiFixed = par.getParameter<double>("Phi_fixed");
67  theEtaFixed = par.getParameter<double>("Eta_fixed");
68 
69  thePhiMin = par.getParameter<double>("Phi_min");
70  theEtaMin = par.getParameter<double>("Eta_min");
71  theHalfZ = par.getParameter<double>("DeltaZ_Region");
72  theDeltaR = par.getParameter<double>("DeltaR");
73 
74  // perigee reference point
75 
76  theOnDemand = par.getParameter<double>("OnDemand");
77  theMeasurementTrackerName = par.getParameter<std::string>("MeasurementTrackerName");
78 }
T getParameter(std::string const &) const
void MuonTrackingRegionBuilder::init ( const MuonServiceProxy service)
RectangularEtaPhiTrackingRegion * MuonTrackingRegionBuilder::region ( const reco::TrackRef track) const

define tracking region

Definition at line 85 of file MuonTrackingRegionBuilder.cc.

Referenced by GlobalTrajectoryBuilderBase::defineRegionOfInterest(), FastTSGFromL2Muon::produce(), TSGFromL2Muon::produce(), and HIMuonTrackingRegionProducer::regions().

85  {
86 
87  return region(*track);
88 
89 }
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
RectangularEtaPhiTrackingRegion * MuonTrackingRegionBuilder::region ( const reco::Track staTrack) const

define tracking region

Definition at line 106 of file MuonTrackingRegionBuilder.cc.

References deltaR(), eta(), PerigeeConversions::ftsToPerigeeError(), trajectoryStateTransform::initialFreeState(), reco::Track::innerMomentum(), TrajectoryStateClosestToBeamLine::isValid(), LogDebug, max(), bookConverter::min, gsfElectronCkfTrackCandidateMaker_cff::minPt, FreeTrajectoryState::momentum(), reco::TrackBase::p(), phi, PerigeeTrajectoryError::phiError(), RecoTauCleanerPlugins::pt, funct::sin(), theta(), PerigeeTrajectoryError::thetaError(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), GoodVertex_cfg::vertexCollection, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

106  {
107 
108  // get the free trajectory state of the muon updated at vertex
109  TSCPBuilderNoMaterial tscpBuilder;
110 
112 
113  LogDebug("MuonTrackingRegionBuilder")<<"from state: "<<muFTS;
114 
115  // get track direction at vertex
116  GlobalVector dirVector(muFTS.momentum());
117 
118  // get track momentum
119  const math::XYZVector& mo = staTrack.innerMomentum();
120  GlobalVector mom(mo.x(),mo.y(),mo.z());
121  if ( staTrack.p() > 1.5 ) {
122  mom = dirVector;
123  }
124 
125  // initial vertex position - in the following it is replaced with beam spot/vertexing
126  GlobalPoint vertexPos(0.0,0.0,0.0);
127  double deltaZatVTX = 0.0;
128 
129  // retrieve beam spot information
131  bool bsHandleFlag = theEvent->getByLabel(theBeamSpotTag, bsHandle);
132  // check the validity, otherwise vertexing
133  // inizialization of BS
134 
135  if ( bsHandleFlag && !useVertex ) {
136  const reco::BeamSpot& bs = *bsHandle;
137  vertexPos = GlobalPoint(bs.x0(), bs.y0(), bs.z0());
138  } else {
139  // get originZPos from list of reconstructed vertices (first or all)
141  bool vtxHandleFlag = theEvent->getByLabel(theVertexCollTag,vertexCollection);
142  // check if there exists at least one reconstructed vertex
143  if ( vtxHandleFlag && !vertexCollection->empty() ) {
144  // use the first vertex in the collection and assume it is the primary event vertex
145  reco::VertexCollection::const_iterator vtx = vertexCollection->begin();
146  vertexPos = GlobalPoint(vtx->x(),vtx->y(),vtx->z());
147  // delta Z from vertex error
148  deltaZatVTX = vtx->zError() * theNsigmaDz;
149  }
150  }
151 
152 
153  // inizialize to the maximum possible value to avoit
154  // problems with TSCBL
155 
156  double deta = 0.4;
157  double dphi = 0.6;
158 
159  // take into account the correct beanspot rotation
160  if ( bsHandleFlag ) {
161 
162  const reco::BeamSpot& bs = *bsHandle;
163 
164  TSCBLBuilderNoMaterial tscblBuilder;
165  TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(muFTS,bs);
166 
167 
168  // evaluate the dynamical region if possible
169  if(tscbl.isValid()){
170 
172  GlobalVector pTrack = tscbl.trackStateAtPCA().momentum();
173 
174  // calculate deltaEta from deltaTheta
175  double deltaTheta = trackPerigeeErrors.thetaError();
176  double theta = pTrack.theta();
177  double sin_theta = sin(theta);
178 
179  // get dEta and dPhi
180  deta = theNsigmaEta*(1/fabs(sin_theta))*deltaTheta;
181  dphi = theNsigmaPhi*(trackPerigeeErrors.phiError());
182 
183  }
184  }
185 
186  /* Region_Parametrizations to take into account possible
187  L2 error matrix inconsistencies. Detailed Explanation in TWIKI
188  page.
189  */
190  double region_dEta = 0;
191  double region_dPhi = 0;
192  double eta=0; double phi=0;
193 
194  // eta, pt parametrization from MC study
195  float pt = fabs(mom.perp());
196 
197  if ( pt <= 10. ) {
198  // angular coefficients
199  float acoeff_Phi = (thePhiRegionPar2 - thePhiRegionPar1)/5;
200  float acoeff_Eta = (theEtaRegionPar2 - theEtaRegionPar1)/5;
201 
202  eta = theEtaRegionPar1 + (acoeff_Eta)*(mom.perp()-5.);
203  phi = thePhiRegionPar1 + (acoeff_Phi)*(mom.perp()-5.) ;
204  }
205  // parametrization 2nd bin in pt from MC study
206  if ( pt > 10. && pt < 100. ) {
207  eta = theEtaRegionPar2;
208  phi = thePhiRegionPar2;
209  }
210  // parametrization 3rd bin in pt from MC study
211  if ( pt >= 100. ) {
212  // angular coefficients
213  float acoeff_Phi = (thePhiRegionPar1 - thePhiRegionPar2)/900;
214  float acoeff_Eta = (theEtaRegionPar1 - theEtaRegionPar2)/900;
215 
216  eta = theEtaRegionPar2 + (acoeff_Eta)*(mom.perp()-100.);
217  phi = thePhiRegionPar2 + (acoeff_Phi)*(mom.perp()-100.);
218  }
219 
220  // decide to use either a parametrization or a dynamical region
221  double region_dPhi1 = min(phi,dphi);
222  double region_dEta1 = min(eta,deta);
223 
224  // minimum size
225  region_dPhi = max(thePhiMin,region_dPhi1);
226  region_dEta = max(theEtaMin,region_dEta1);
227 
228  float deltaZ = 0.0;
229  // standard 15.9 is useVertex than region from vertexing
230  if ( useVertex ) {
231  deltaZ = max(theHalfZ,deltaZatVTX);
232  } else {
233  deltaZ = theHalfZ;
234  }
235 
236  float deltaR = theDeltaR;
237  double minPt = max(theTkEscapePt,mom.perp()*0.6);
238 
240 
241  if (useFixedRegion) {
242  region_dEta = theEtaFixed;
243  region_dPhi = thePhiFixed;
244  }
245 
246  region = new RectangularEtaPhiTrackingRegion(dirVector, vertexPos,
247  minPt, deltaR,
248  deltaZ, region_dEta, region_dPhi,
249  theOnDemand,
250  true,/*default in the header*/
252 
253  LogDebug("MuonTrackingRegionBuilder")<<"the region parameters are:\n"
254  <<"\n dirVector: "<<dirVector
255  <<"\n vertexPos: "<<vertexPos
256  <<"\n minPt: "<<minPt
257  <<"\n deltaR:"<<deltaR
258  <<"\n deltaZ:"<<deltaZ
259  <<"\n region_dEta:"<<region_dEta
260  <<"\n region_dPhi:"<<region_dPhi
261  <<"\n on demand parameter: "<<theOnDemand;
262 
263 
264  return region;
265 
266 }
#define LogDebug(id)
RectangularEtaPhiTrackingRegion * region(const reco::TrackRef &) const
define tracking region
double p() const
momentum vector magnitude
Definition: TrackBase.h:127
double z0() const
z coordinate
Definition: BeamSpot.h:68
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Geom::Theta< T > theta() const
T eta() const
const MuonServiceProxy * theService
tuple vertexCollection
const T & max(const T &a, const T &b)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
GlobalVector momentum() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field)
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:44
double y0() const
y coordinate
Definition: BeamSpot.h:66
PerigeeTrajectoryError ftsToPerigeeError(const FTS &originalFTS)
double x0() const
x coordinate
Definition: BeamSpot.h:64
Definition: DDAxes.h:10
void MuonTrackingRegionBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Definition at line 95 of file MuonTrackingRegionBuilder.cc.

References event().

Referenced by FastTSGFromL2Muon::produce(), TSGFromL2Muon::produce(), HIMuonTrackingRegionProducer::regions(), and GlobalTrajectoryBuilderBase::setEvent().

95  {
96 
97  theEvent = &event;
98 
99 }
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

Member Data Documentation

edm::InputTag MuonTrackingRegionBuilder::theBeamSpotTag
private

Definition at line 53 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theDeltaR
private

Definition at line 72 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theEtaFixed
private

Definition at line 73 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theEtaMin
private

Definition at line 71 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theEtaRegionPar1
private

Definition at line 65 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theEtaRegionPar2
private

Definition at line 66 of file MuonTrackingRegionBuilder.h.

const edm::Event* MuonTrackingRegionBuilder::theEvent
private

Definition at line 56 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theHalfZ
private

Definition at line 72 of file MuonTrackingRegionBuilder.h.

std::string MuonTrackingRegionBuilder::theMeasurementTrackerName
private

Definition at line 78 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theNsigmaDz
private

Definition at line 63 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theNsigmaEta
private

Definition at line 63 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theNsigmaPhi
private

Definition at line 63 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theOnDemand
private

Definition at line 77 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::thePhiFixed
private

Definition at line 73 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::thePhiMin
private

Definition at line 70 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::thePhiRegionPar1
private

Definition at line 67 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::thePhiRegionPar2
private

Definition at line 68 of file MuonTrackingRegionBuilder.h.

const MuonServiceProxy* MuonTrackingRegionBuilder::theService
private

Definition at line 57 of file MuonTrackingRegionBuilder.h.

double MuonTrackingRegionBuilder::theTkEscapePt
private

Definition at line 62 of file MuonTrackingRegionBuilder.h.

edm::InputTag MuonTrackingRegionBuilder::theVertexCollTag
private

Definition at line 54 of file MuonTrackingRegionBuilder.h.

GlobalPoint MuonTrackingRegionBuilder::theVertexPos
private

Definition at line 75 of file MuonTrackingRegionBuilder.h.

bool MuonTrackingRegionBuilder::useFixedRegion
private

Definition at line 59 of file MuonTrackingRegionBuilder.h.

bool MuonTrackingRegionBuilder::useVertex
private

Definition at line 60 of file MuonTrackingRegionBuilder.h.