146 std::vector<edm::InputTag> ecalLabels_;
152 if(ecalInAlca)ecalLabels_.push_back(
edm::InputTag(
"IsoProd",
"IsoTrackEcalRecHitCollection"));
154 ecalLabels_.push_back(
edm::InputTag(
"ecalRecHit",
"EcalRecHitsEB"));
155 ecalLabels_.push_back(
edm::InputTag(
"ecalRecHit",
"EcalRecHitsEE"));
157 else throw cms::Exception(
"MissingProduct",
"can not find EcalRecHits");
159 std::vector<edm::InputTag>::const_iterator
i;
160 for (i=ecalLabels_.begin(); i!=ecalLabels_.end(); i++)
166 tmpEcalRecHitCollection->push_back(*
recHit);
192 if(isoPixelTracks->empty())
return;
194 for(reco::TrackCollection::const_iterator
track = tracks->begin();
track!=tracks->end();++
track){
196 bool noChargedTracks =
true;
198 if(
track->p()<9.)
continue;
210 if(trackhac3<5.)
continue;
217 for (reco::TrackCollection::const_iterator track1 = tracks->begin(); track1!=tracks->end(); track1++)
219 if (
track == track1)
continue;
224 if (etaecal1==0&&phiecal1==0)
continue;
226 double ecDist=
getDistInCM(etaecal,phiecal,etaecal1,phiecal1);
231 if (track1->p()>maxPNearby)
233 maxPNearby=track1->p();
240 noChargedTracks =
false;
248 for (std::vector<EcalRecHit>::const_iterator ehit=tmpEcalRecHitCollection->begin(); ehit!=tmpEcalRecHitCollection->end(); ehit++)
253 double phihit = posH.
phi();
254 double etahit = posH.
eta();
256 double dHitCM=
getDistInCM(etaecal,phiecal,etahit,phihit);
260 EnergyIn+=ehit->energy();
262 if (dHitCM>15.0&&dHitCM<35.0)
264 EnergyOut+=ehit->energy();
270 track->numberOfValidHits(),
track->numberOfLostHits(),
274 trackemc1, trackemc3, trackemc5,
275 trackhac1, trackhac3, trackhac5,
276 maxPNearby, dist, EnergyIn, EnergyOut);
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
std::vector< EcalRecHit >::const_iterator const_iterator
double nXnEnergy(const DetId &, EnergyType, int gridSize=1)
get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
TrackAssociatorParameters parameters_
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
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_
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_