111 consumes<reco::IsolatedPixelTrackCandidateCollection>(
edm::InputTag(
"IsoProd",
"HcalIsolatedTrackCollection"));
135 std::vector<edm::EDGetTokenT<EcalRecHitCollection> > ecalTokens_;
138 else if (ecalInReco) {
142 throw cms::Exception(
"MissingProduct",
"can not find EcalRecHits");
145 for (
const auto&
i : ecalTokens_) {
148 tmpEcalRecHitCollection->push_back(*
recHit);
155 bool pixelInAlca = isoPixelTracks.
isValid();
171 if (isoPixelTracks->empty())
175 bool noChargedTracks =
true;
197 double etaecal =
info.trkGlobPosAtEcal.eta();
198 double phiecal =
info.trkGlobPosAtEcal.phi();
202 for (
const auto& track1 :
tracks) {
203 if (&
track == &track1) {
210 if (etaecal1 == 0 && phiecal1 == 0)
213 double ecDist =
getDistInCM(etaecal, phiecal, etaecal1, phiecal1);
217 if (track1.p() > maxPNearby) {
218 maxPNearby = track1.p();
223 if (track1.p() > 5.) {
224 noChargedTracks =
false;
231 if (noChargedTracks) {
232 for (std::vector<EcalRecHit>::const_iterator ehit = tmpEcalRecHitCollection->begin();
233 ehit != tmpEcalRecHitCollection->end();
238 double phihit = posH.
phi();
239 double etahit = posH.
eta();
241 double dHitCM =
getDistInCM(etaecal, phiecal, etahit, phihit);
244 EnergyIn += ehit->energy();
246 if (dHitCM > 15.0 && dHitCM < 35.0) {
247 EnergyOut += ehit->energy();
254 track.numberOfValidHits(),
255 track.numberOfLostHits(),
257 track.normalizedChi2(),
290 static constexpr
float EEBoundary = 1.479;
291 static constexpr
float EBRadius = 129;
292 static constexpr
float EEIPdis = 317;
301 double theta1 = 2 * atan(
exp(-
eta1));
302 double theta2 = 2 * atan(
exp(-
eta2));
304 if (
cos(theta1) == 0)
307 cotantheta1 = 1 /
tan(theta1);
309 if (
cos(theta2) == 0)
312 cotantheta2 = 1 /
tan(theta2);
318 if (fabs(
eta1) < EEBoundary) {
332 desc.setComment(
"Generate tree for Tracker Alignment E/p validation");
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",
false);
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);
static const std::string kSharedResource
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
container to hold data to be written into TTree
Geom::Phi< T > phi() const
void useDefaultPropagator()
use the default propagator
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< EcalRecHit >::const_iterator const_iterator
~EopTreeWriter() override=default
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > isoPixelTkToken_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenEBRecoToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Cos< T >::type cos(const T &t)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
Tan< T >::type tan(const T &t)
TrackAssociatorParameters parameters_
#define DEFINE_FWK_MODULE(type)
bool getData(T &iHolder) const
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
ParameterDescriptionBase * add(U const &iLabel, T const &value)
TrackDetectorAssociator trackAssociator_
static void fillDescriptions(edm::ConfigurationDescriptions &)
auto const & tracks
cannot be loose
edm::EDGetTokenT< EcalRecHitCollection > ecalRecHitTokenAlCaToken_
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken_
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
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_
T * make(const Args &...args) const
make new ROOT object
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
EopVariables * treeMemPtr_
EopTreeWriter(const edm::ParameterSet &)