CMS 3D CMS Logo

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

#include <Alignment/OfflineValidation/plugins/EopTreeWriter.cc>

Inheritance diagram for EopTreeWriter:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EopTreeWriter (const edm::ParameterSet &)
 
 ~EopTreeWriter () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 
double getDistInCM (double eta1, double phi1, double eta2, double phi2)
 

Private Attributes

edm::EDGetTokenT
< EcalRecHitCollection
ecalRecHitTokenAlCaToken_
 
edm::EDGetTokenT
< EcalRecHitCollection
ecalRecHitTokenEBRecoToken_
 
edm::EDGetTokenT
< EcalRecHitCollection
ecalRecHitTokenEERecoToken_
 
edm::Service< TFileServicefs_
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geometryToken_
 
edm::EDGetTokenT
< reco::IsolatedPixelTrackCandidateCollection
isoPixelTkToken_
 
TrackAssociatorParameters parameters_
 
edm::InputTag src_
 
edm::EDGetTokenT
< reco::TrackCollection
theTrackCollectionToken_
 
TrackDetectorAssociator trackAssociator_
 
TTree * tree_
 
EopVariablestreeMemPtr_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 62 of file EopTreeWriter.cc.

Constructor & Destructor Documentation

EopTreeWriter::EopTreeWriter ( const edm::ParameterSet iConfig)
explicit

Definition at line 94 of file EopTreeWriter.cc.

References edm::EDConsumerBase::consumesCollector(), ecalRecHitTokenAlCaToken_, ecalRecHitTokenEBRecoToken_, ecalRecHitTokenEERecoToken_, fs_, edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, isoPixelTkToken_, TFileService::kSharedResource, TrackAssociatorParameters::loadParameters(), TFileService::make(), parameters_, src_, theTrackCollectionToken_, tree_, and treeMemPtr_.

96  usesResource(TFileService::kSharedResource);
97  //now do what ever initialization is needed
98 
99  // TrackAssociator parameters
100  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
102  parameters_.loadParameters(parameters, iC);
103 
104  tree_ = fs_->make<TTree>("EopTree", "EopTree");
106  tree_->Branch("EopVariables", &treeMemPtr_); // address of pointer!
107 
108  // do the consumes
109  theTrackCollectionToken_ = consumes<reco::TrackCollection>(src_);
111  consumes<reco::IsolatedPixelTrackCandidateCollection>(edm::InputTag("IsoProd", "HcalIsolatedTrackCollection"));
112 
113  ecalRecHitTokenAlCaToken_ = consumes<EcalRecHitCollection>(edm::InputTag("IsoProd", "IsoTrackEcalRecHitCollection"));
114  ecalRecHitTokenEBRecoToken_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
115  ecalRecHitTokenEERecoToken_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
116 }
static const std::string kSharedResource
Definition: TFileService.h:76
container to hold data to be written into TTree
Definition: EopVariables.h:8
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::InputTag src_
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > isoPixelTkToken_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenEBRecoToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
TrackAssociatorParameters parameters_
edm::Service< TFileService > fs_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenAlCaToken_
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenEERecoToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
EopVariables * treeMemPtr_
EopTreeWriter::~EopTreeWriter ( )
overridedefault

Member Function Documentation

void EopTreeWriter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 123 of file EopTreeWriter.cc.

References TrackDetectorAssociator::associate(), TrackAssociatorParameters::bFieldToken, TrackDetMatchInfo::EcalRecHits, ecalRecHitTokenAlCaToken_, ecalRecHitTokenEBRecoToken_, ecalRecHitTokenEERecoToken_, PV3DBase< T, PVType, FrameType >::eta(), Exception, EopVariables::fillVariables(), geometryToken_, edm::Event::get(), edm::EventSetup::getData(), getDistInCM(), TrackDetectorAssociator::getFreeTrajectoryState(), edm::Event::getHandle(), TrackDetMatchInfo::HcalRecHits, mps_fire::i, info(), isoPixelTkToken_, TrackDetMatchInfo::nXnEnergy(), parameters_, PV3DBase< T, PVType, FrameType >::phi(), theTrackCollectionToken_, HLT_FULL_cff::track, trackAssociator_, tracks, tree_, treeMemPtr_, TrackDetMatchInfo::trkGlobPosAtEcal, TrackDetectorAssociator::useDefaultPropagator(), and TrackAssociatorParameters::useMuon.

123  {
124  using namespace edm;
125 
126  // get geometry
127  const CaloGeometry* geo = &iSetup.getData(geometryToken_);
128 
129  // temporary collection of EB+EE recHits
130  std::unique_ptr<EcalRecHitCollection> tmpEcalRecHitCollection(new EcalRecHitCollection);
131  bool ecalInAlca = iEvent.getHandle(ecalRecHitTokenAlCaToken_).isValid();
132  bool ecalInReco =
134 
135  std::vector<edm::EDGetTokenT<EcalRecHitCollection> > ecalTokens_;
136  if (ecalInAlca)
137  ecalTokens_.push_back(ecalRecHitTokenAlCaToken_);
138  else if (ecalInReco) {
139  ecalTokens_.push_back(ecalRecHitTokenEBRecoToken_);
140  ecalTokens_.push_back(ecalRecHitTokenEERecoToken_);
141  } else {
142  throw cms::Exception("MissingProduct", "can not find EcalRecHits");
143  }
144 
145  for (const auto& i : ecalTokens_) {
147  for (EcalRecHitCollection::const_iterator recHit = (*ec).begin(); recHit != (*ec).end(); ++recHit) {
148  tmpEcalRecHitCollection->push_back(*recHit);
149  }
150  }
151 
152  const auto& tracks = iEvent.get(theTrackCollectionToken_);
153 
155  bool pixelInAlca = isoPixelTracks.isValid();
156 
157  double trackemc1;
158  double trackemc3;
159  double trackemc5;
160  double trackhac1;
161  double trackhac3;
162  double trackhac5;
163  double maxPNearby;
164  double dist;
165  double EnergyIn;
166  double EnergyOut;
167 
168  parameters_.useMuon = false;
169 
170  if (pixelInAlca)
171  if (isoPixelTracks->empty())
172  return;
173 
174  for (const auto& track : tracks) {
175  bool noChargedTracks = true;
176 
177  if (track.p() < 9.)
178  continue;
179 
182  iEvent,
183  iSetup,
185  parameters_);
186 
187  trackemc1 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 0);
188  trackemc3 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 1);
189  trackemc5 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 2);
190  trackhac1 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 0);
191  trackhac3 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 1);
192  trackhac5 = info.nXnEnergy(TrackDetMatchInfo::HcalRecHits, 2);
193 
194  if (trackhac3 < 5.)
195  continue;
196 
197  double etaecal = info.trkGlobPosAtEcal.eta();
198  double phiecal = info.trkGlobPosAtEcal.phi();
199 
200  maxPNearby = -10;
201  dist = 50;
202  for (const auto& track1 : tracks) {
203  if (&track == &track1) {
204  continue;
205  }
206  TrackDetMatchInfo info1 = trackAssociator_.associate(iEvent, iSetup, track1, parameters_);
207  double etaecal1 = info1.trkGlobPosAtEcal.eta();
208  double phiecal1 = info1.trkGlobPosAtEcal.phi();
209 
210  if (etaecal1 == 0 && phiecal1 == 0)
211  continue;
212 
213  double ecDist = getDistInCM(etaecal, phiecal, etaecal1, phiecal1);
214 
215  if (ecDist < 40.) {
216  //calculate maximum P and sum P near seed track
217  if (track1.p() > maxPNearby) {
218  maxPNearby = track1.p();
219  dist = ecDist;
220  }
221 
222  //apply loose isolation criteria
223  if (track1.p() > 5.) {
224  noChargedTracks = false;
225  break;
226  }
227  }
228  }
229  EnergyIn = 0;
230  EnergyOut = 0;
231  if (noChargedTracks) {
232  for (std::vector<EcalRecHit>::const_iterator ehit = tmpEcalRecHitCollection->begin();
233  ehit != tmpEcalRecHitCollection->end();
234  ehit++) {
236  // R-scheme of ECAL CLUSTERIZATION
237  const GlobalPoint& posH = geo->getPosition((*ehit).detid());
238  double phihit = posH.phi();
239  double etahit = posH.eta();
240 
241  double dHitCM = getDistInCM(etaecal, phiecal, etahit, phihit);
242 
243  if (dHitCM < 9.0) {
244  EnergyIn += ehit->energy();
245  }
246  if (dHitCM > 15.0 && dHitCM < 35.0) {
247  EnergyOut += ehit->energy();
248  }
249  }
250 
251  treeMemPtr_->fillVariables(track.charge(),
252  track.innerOk(),
253  track.outerRadius(),
254  track.numberOfValidHits(),
255  track.numberOfLostHits(),
256  track.chi2(),
257  track.normalizedChi2(),
258  track.p(),
259  track.pt(),
260  track.ptError(),
261  track.theta(),
262  track.eta(),
263  track.phi(),
264  trackemc1,
265  trackemc3,
266  trackemc5,
267  trackhac1,
268  trackhac3,
269  trackhac5,
270  maxPNearby,
271  dist,
272  EnergyIn,
273  EnergyOut);
274 
275  tree_->Fill();
276  }
277  }
278 }
static const TGPicture * info(bool iBackgroundIsBlack)
void useDefaultPropagator()
use the default propagator
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< EcalRecHit >::const_iterator const_iterator
auto const & tracks
cannot be loose
double nXnEnergy(const DetId &, EnergyType, int gridSize=1)
get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > isoPixelTkToken_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenEBRecoToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
TrackAssociatorParameters parameters_
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
void fillVariables(Int_t charge, Int_t innerOk, Double_t outerRadius, Int_t numberOfValidHits, Int_t numberOfLostHits, Double_t chi2, Double_t normalizedChi2, Double_t p, Double_t pt, Double_t ptError, Double_t theta, Double_t eta, Double_t phi, Double_t emc1, Double_t emc3, Double_t emc5, Double_t hac1, Double_t hac3, Double_t hac5, Double_t maxPNearby, Double_t dist, Double_t EnergyIn, Double_t EnergyOut)
fill variables into tree
Definition: EopVariables.h:22
TrackDetectorAssociator trackAssociator_
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenAlCaToken_
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken_
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
T eta() const
Definition: PV3DBase.h:73
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenEERecoToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
EopVariables * treeMemPtr_
void EopTreeWriter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 281 of file EopTreeWriter.cc.

References treeMemPtr_.

Referenced by o2olib.O2ORunMgr::executeJob().

281  {
282  delete treeMemPtr_;
283  treeMemPtr_ = nullptr;
284 }
EopVariables * treeMemPtr_
void EopTreeWriter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 328 of file EopTreeWriter.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and edm::ParameterSetDescription::setComment().

330 {
332  desc.setComment("Generate tree for Tracker Alignment E/p validation");
333  desc.add<edm::InputTag>("src", edm::InputTag("generalTracks"));
334 
335  // track association
337  psd0.add<bool>("accountForTrajectoryChangeCalo", false);
338  psd0.add<bool>("propagateAllDirections", true);
339  psd0.add<bool>("truthMatch", false);
340  psd0.add<bool>("useCalo", false);
341  psd0.add<bool>("useEcal", true);
342  psd0.add<bool>("useGEM", false);
343  psd0.add<bool>("useHO", true);
344  psd0.add<bool>("useHcal", true);
345  psd0.add<bool>("useME0", false);
346  psd0.add<bool>("useMuon", true);
347  psd0.add<bool>("usePreshower", false);
348  psd0.add<double>("dREcal", 9999.0);
349  psd0.add<double>("dREcalPreselection", 0.05);
350  psd0.add<double>("dRHcal", 9999.0);
351  psd0.add<double>("dRHcalPreselection", 0.2);
352  psd0.add<double>("dRMuon", 9999.0);
353  psd0.add<double>("dRMuonPreselection", 0.2);
354  psd0.add<double>("dRPreshowerPreselection", 0.2);
355  psd0.add<double>("muonMaxDistanceSigmaX", 0.0);
356  psd0.add<double>("muonMaxDistanceSigmaY", 0.0);
357  psd0.add<double>("muonMaxDistanceX", 5.0);
358  psd0.add<double>("muonMaxDistanceY", 5.0);
359  psd0.add<double>("trajectoryUncertaintyTolerance", -1.0);
360  psd0.add<edm::InputTag>("CSCSegmentCollectionLabel", edm::InputTag("cscSegments"));
361  psd0.add<edm::InputTag>("CaloTowerCollectionLabel", edm::InputTag("towerMaker"));
362  psd0.add<edm::InputTag>("DTRecSegment4DCollectionLabel", edm::InputTag("dt4DSegments"));
363  psd0.add<edm::InputTag>("EBRecHitCollectionLabel", edm::InputTag("IsoProd", "IsoTrackEcalRecHitCollection"));
364  psd0.add<edm::InputTag>("EERecHitCollectionLabel", edm::InputTag("IsoProd", "IsoTrackEcalRecHitCollection"));
365  psd0.add<edm::InputTag>("GEMSegmentCollectionLabel", edm::InputTag("gemSegments"));
366  psd0.add<edm::InputTag>("HBHERecHitCollectionLabel", edm::InputTag("IsoProd", "IsoTrackHBHERecHitCollection"));
367  psd0.add<edm::InputTag>("HORecHitCollectionLabel", edm::InputTag("IsoProd", "IsoTrackHORecHitCollection"));
368  psd0.add<edm::InputTag>("ME0SegmentCollectionLabel", edm::InputTag("me0Segments"));
369  desc.add<edm::ParameterSetDescription>("TrackAssociatorParameters", psd0);
370 
371  descriptions.addWithDefaultLabel(desc);
372 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double EopTreeWriter::getDistInCM ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)
private

Definition at line 287 of file EopTreeWriter.cc.

References funct::cos(), srCondWrite_cfg::deltaPhi, funct::exp(), M_PI, mathSSE::sqrt(), and funct::tan().

Referenced by analyze().

287  {
288  //*************************************************************
289 
290  static constexpr float EEBoundary = 1.479; // psedo-rapidity
291  static constexpr float EBRadius = 129; // in cm
292  static constexpr float EEIPdis = 317; // in cm
293 
294  double deltaPhi = phi1 - phi2;
295  while (deltaPhi > M_PI)
296  deltaPhi -= 2 * M_PI;
297  while (deltaPhi <= -M_PI)
298  deltaPhi += 2 * M_PI;
299  double dR;
300  // double Rec;
301  double theta1 = 2 * atan(exp(-eta1));
302  double theta2 = 2 * atan(exp(-eta2));
303  double cotantheta1;
304  if (cos(theta1) == 0)
305  cotantheta1 = 0;
306  else
307  cotantheta1 = 1 / tan(theta1);
308  double cotantheta2;
309  if (cos(theta2) == 0)
310  cotantheta2 = 0;
311  else
312  cotantheta2 = 1 / tan(theta2);
313  // if (fabs(eta1)<1.479) Rec=129; //radius of ECAL barrel
314  // else Rec=317; //distance from IP to ECAL endcap
315  //|vect| times tg of acos(scalar product)
316  // dR=fabs((Rec/sin(theta1))*tan(acos(sin(theta1)*sin(theta2)*(sin(phi1)*sin(phi2)+cos(phi1)*cos(phi2))+cos(theta1)*cos(theta2))));
317 
318  if (fabs(eta1) < EEBoundary) {
319  dR = EBRadius * sqrt((cotantheta1 - cotantheta2) * (cotantheta1 - cotantheta2) + deltaPhi * deltaPhi);
320  } else {
321  dR = EEIPdis *
322  sqrt(tan(theta1) * tan(theta1) + tan(theta2) * tan(theta2) - 2 * tan(theta1) * tan(theta2) * cos(deltaPhi));
323  }
324  return dR;
325 }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
#define M_PI

Member Data Documentation

edm::EDGetTokenT<EcalRecHitCollection> EopTreeWriter::ecalRecHitTokenAlCaToken_
private

Definition at line 86 of file EopTreeWriter.cc.

Referenced by analyze(), and EopTreeWriter().

edm::EDGetTokenT<EcalRecHitCollection> EopTreeWriter::ecalRecHitTokenEBRecoToken_
private

Definition at line 87 of file EopTreeWriter.cc.

Referenced by analyze(), and EopTreeWriter().

edm::EDGetTokenT<EcalRecHitCollection> EopTreeWriter::ecalRecHitTokenEERecoToken_
private

Definition at line 88 of file EopTreeWriter.cc.

Referenced by analyze(), and EopTreeWriter().

edm::Service<TFileService> EopTreeWriter::fs_
private

Definition at line 78 of file EopTreeWriter.cc.

Referenced by EopTreeWriter().

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EopTreeWriter::geometryToken_
private

Definition at line 76 of file EopTreeWriter.cc.

Referenced by analyze().

edm::EDGetTokenT<reco::IsolatedPixelTrackCandidateCollection> EopTreeWriter::isoPixelTkToken_
private

Definition at line 85 of file EopTreeWriter.cc.

Referenced by analyze(), and EopTreeWriter().

TrackAssociatorParameters EopTreeWriter::parameters_
private
edm::InputTag EopTreeWriter::src_
private

Definition at line 75 of file EopTreeWriter.cc.

Referenced by EopTreeWriter().

edm::EDGetTokenT<reco::TrackCollection> EopTreeWriter::theTrackCollectionToken_
private

Definition at line 84 of file EopTreeWriter.cc.

Referenced by analyze(), and EopTreeWriter().

TrackDetectorAssociator EopTreeWriter::trackAssociator_
private

Definition at line 81 of file EopTreeWriter.cc.

Referenced by analyze().

TTree* EopTreeWriter::tree_
private

Definition at line 79 of file EopTreeWriter.cc.

Referenced by analyze(), and EopTreeWriter().

EopVariables* EopTreeWriter::treeMemPtr_
private

Definition at line 80 of file EopTreeWriter.cc.

Referenced by analyze(), endJob(), and EopTreeWriter().