|
|
Go to the documentation of this file.
102 : src_(iConfig.getParameter<
edm::
InputTag>(
"src")), geometryToken_(esConsumes()) {
136 std::vector<edm::InputTag> ecalLabels_;
139 bool ecalInAlca =
iEvent.getByLabel(
edm::InputTag(
"IsoProd",
"IsoTrackEcalRecHitCollection"), tmpEc);
140 bool ecalInReco =
iEvent.getByLabel(
edm::InputTag(
"ecalRecHit",
"EcalRecHitsEB"), tmpEc) &&
143 ecalLabels_.push_back(
edm::InputTag(
"IsoProd",
"IsoTrackEcalRecHitCollection"));
144 else if (ecalInReco) {
145 ecalLabels_.push_back(
edm::InputTag(
"ecalRecHit",
"EcalRecHitsEB"));
146 ecalLabels_.push_back(
edm::InputTag(
"ecalRecHit",
"EcalRecHitsEE"));
148 throw cms::Exception(
"MissingProduct",
"can not find EcalRecHits");
150 std::vector<edm::InputTag>::const_iterator
i;
151 for (
i = ecalLabels_.begin();
i != ecalLabels_.end();
i++) {
155 tmpEcalRecHitCollection->push_back(*
recHit);
164 bool pixelInAlca =
iEvent.getByLabel(
edm::InputTag(
"IsoProd",
"HcalIsolatedTrackCollection"), tmpPix);
166 iEvent.getByLabel(
edm::InputTag(
"IsoProd",
"HcalIsolatedTrackCollection"), isoPixelTracks);
182 if (isoPixelTracks->empty())
186 bool noChargedTracks =
true;
208 double etaecal =
info.trkGlobPosAtEcal.eta();
209 double phiecal =
info.trkGlobPosAtEcal.phi();
213 for (reco::TrackCollection::const_iterator track1 =
tracks->begin(); track1 !=
tracks->end(); track1++) {
220 if (etaecal1 == 0 && phiecal1 == 0)
223 double ecDist =
getDistInCM(etaecal, phiecal, etaecal1, phiecal1);
227 if (track1->p() > maxPNearby) {
228 maxPNearby = track1->p();
233 if (track1->p() > 5.) {
234 noChargedTracks =
false;
241 if (noChargedTracks) {
242 for (std::vector<EcalRecHit>::const_iterator ehit = tmpEcalRecHitCollection->begin();
243 ehit != tmpEcalRecHitCollection->end();
248 double phihit = posH.
phi();
249 double etahit = posH.
eta();
251 double dHitCM =
getDistInCM(etaecal, phiecal, etahit, phihit);
254 EnergyIn += ehit->energy();
256 if (dHitCM > 15.0 && dHitCM < 35.0) {
257 EnergyOut += ehit->energy();
263 track->outerRadius(),
264 track->numberOfValidHits(),
265 track->numberOfLostHits(),
267 track->normalizedChi2(),
307 double theta1 = 2 * atan(
exp(-
eta1));
308 double theta2 = 2 * atan(
exp(-
eta2));
310 if (
cos(theta1) == 0)
313 cotantheta1 = 1 /
tan(theta1);
315 if (
cos(theta2) == 0)
318 cotantheta2 = 1 /
tan(theta2);
323 if (fabs(
eta1) < 1.479)
container to hold data to be written into TTree
std::vector< EcalRecHit >::const_iterator const_iterator
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
TrackDetectorAssociator trackAssociator_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
void useDefaultPropagator()
use the default propagator
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
EopVariables * treeMemPtr_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
edm::Service< TFileService > fs_
Cos< T >::type cos(const T &t)
#define DEFINE_FWK_MODULE(type)
TrackAssociatorParameters parameters_
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
Tan< T >::type tan(const T &t)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
bool getData(T &iHolder) const
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
EopTreeWriter(const edm::ParameterSet &)
static const std::string kSharedResource
T getParameter(std::string const &) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
~EopTreeWriter() override
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
Geom::Phi< T > phi() const
void analyze(const edm::Event &, const edm::EventSetup &) override
T * make(const Args &... args) const
make new ROOT object