111 tree_->Branch(
"EopVariables", &treeMemPtr_);
136 std::vector<edm::InputTag> ecalLabels_;
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);
182 if (isoPixelTracks->empty())
185 for (reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end(); ++
track) {
186 bool noChargedTracks =
true;
210 for (reco::TrackCollection::const_iterator track1 = tracks->begin(); track1 != tracks->end(); track1++) {
217 if (etaecal1 == 0 && phiecal1 == 0)
220 double ecDist =
getDistInCM(etaecal, phiecal, etaecal1, phiecal1);
224 if (track1->p() > maxPNearby) {
225 maxPNearby = track1->p();
230 if (track1->p() > 5.) {
231 noChargedTracks =
false;
238 if (noChargedTracks) {
239 for (std::vector<EcalRecHit>::const_iterator ehit = tmpEcalRecHitCollection->begin();
240 ehit != tmpEcalRecHitCollection->end();
245 double phihit = posH.
phi();
246 double etahit = posH.
eta();
248 double dHitCM =
getDistInCM(etaecal, phiecal, etahit, phihit);
251 EnergyIn += ehit->energy();
253 if (dHitCM > 15.0 && dHitCM < 35.0) {
254 EnergyOut += ehit->energy();
260 track->outerRadius(),
261 track->numberOfValidHits(),
262 track->numberOfLostHits(),
264 track->normalizedChi2(),
304 double theta1 = 2 * atan(
exp(-eta1));
305 double theta2 = 2 * atan(
exp(-eta2));
307 if (
cos(theta1) == 0)
310 cotantheta1 = 1 /
tan(theta1);
312 if (
cos(theta2) == 0)
315 cotantheta2 = 1 /
tan(theta2);
320 if (fabs(eta1) < 1.479)
321 dR = 129 *
sqrt((cotantheta1 - cotantheta2) * (cotantheta1 - cotantheta2) + deltaPhi * deltaPhi);
T getParameter(std::string const &) const
container to hold data to be written into TTree
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
void useDefaultPropagator()
use the default propagator
Geom::Phi< T > phi() const
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< EcalRecHit >::const_iterator const_iterator
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
T * make(const Args &...args) const
make new ROOT object
double nXnEnergy(const DetId &, EnergyType, int gridSize=1)
get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
#define DEFINE_FWK_MODULE(type)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Cos< T >::type cos(const T &t)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Tan< T >::type tan(const T &t)
TrackAssociatorParameters parameters_
edm::Service< TFileService > fs_
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TrackDetectorAssociator trackAssociator_
~EopTreeWriter() override
ESHandle< TrackerGeometry > geometry
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
T const * product() const
EopVariables * treeMemPtr_
EopTreeWriter(const edm::ParameterSet &)