25 #include "TProfile2D.h" 48 std::unique_ptr<TH1D>
h_x;
51 : h2_y_vs_x(new TH2D(
"",
"", 300, -10., +70., 300, -30, +30.)),
52 p_y_vs_x(new TProfile(
"",
"", 300, -10., +70.)),
53 h_x(new TH1D(
"",
"", 600, -10., +70.)) {}
56 h2_y_vs_x->Fill(x, y);
62 h2_y_vs_x->Write(
"h2_y_vs_x");
63 p_y_vs_x->Write(
"p_y_vs_x");
74 : p2_de_x_vs_x_y(new TProfile2D(
"",
";x;y", 40, 0., 40., 40, -20., +20.)),
75 p2_de_y_vs_x_y(new TProfile2D(
"",
";x;y", 40, 0., 40., 40, -20., +20.)) {}
77 void fill(
double x_N,
double y_N,
double x_F,
double y_F) {
78 p2_de_x_vs_x_y->Fill(x_N, y_N, x_F - x_N);
79 p2_de_y_vs_x_y->Fill(x_N, y_N, y_F - y_N);
83 p2_de_x_vs_x_y->Write(
"p2_de_x_vs_x_y");
84 p2_de_y_vs_x_y->Write(
"p2_de_y_vs_x_y");
105 for (
const auto& trk : *tracks) {
107 unsigned int rpDecId = rpId.
arm() * 100 + rpId.station() * 10 + rpId.rp();
108 rpPlots[rpDecId].fill(trk.x(), trk.y());
111 for (
const auto&
t1 : *tracks) {
114 for (
const auto&
t2 : *tracks) {
117 if (rpId1.arm() != rpId2.arm())
120 if (rpId1.station() == 0 && rpId2.station() == 2)
129 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
131 for (
const auto& it :
rpPlots) {
132 gDirectory = f_out->mkdir(Form(
"RP %u", it.first));
137 gDirectory = f_out->mkdir(Form(
"arm %u", it.first));
std::unique_ptr< TProfile2D > p2_de_y_vs_x_y
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void analyze(const edm::Event &, const edm::EventSetup &) override
std::map< unsigned int, ArmPlots > armPlots
~CTPPSTrackDistributionPlotter() override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< CTPPSLocalTrackLiteCollection > tracksToken_
void fill(double x, double y)
std::unique_ptr< TH1D > h_x
std::unique_ptr< TProfile > p_y_vs_x
std::map< unsigned int, RPPlots > rpPlots
std::vector< CTPPSLocalTrackLite > CTPPSLocalTrackLiteCollection
Collection of CTPPSLocalTrackLite objects.
Base class for CTPPS detector IDs.
std::unique_ptr< TH2D > h2_y_vs_x
CTPPSTrackDistributionPlotter(const edm::ParameterSet &)
void fill(double x_N, double y_N, double x_F, double y_F)