26 #include "TProfile2D.h" 51 std::unique_ptr<TH1D>
h_x;
54 h2_y_vs_x(new TH2D(
"",
"", 300, -10., +70., 300, -30, +30.)),
55 p_y_vs_x(new TProfile(
"",
"", 300, -10., +70.)),
56 h_x(new TH1D(
"",
"", 600, -10., +70.))
61 h2_y_vs_x->Fill(x, y);
68 h2_y_vs_x->Write(
"h2_y_vs_x");
69 p_y_vs_x->Write(
"p_y_vs_x");
82 p2_de_x_vs_x_y(new TProfile2D(
"",
";x;y", 40, 0., 40., 40, -20., +20.)),
83 p2_de_y_vs_x_y(new TProfile2D(
"",
";x;y", 40, 0., 40., 40, -20., +20.))
86 void fill(
double x_N,
double y_N,
double x_F,
double y_F)
88 p2_de_x_vs_x_y->Fill(x_N, y_N, x_F - x_N);
89 p2_de_y_vs_x_y->Fill(x_N, y_N, y_F - y_N);
94 p2_de_x_vs_x_y->Write(
"p2_de_x_vs_x_y");
95 p2_de_y_vs_x_y->Write(
"p2_de_y_vs_x_y");
119 for (
const auto& trk : *tracks) {
121 unsigned int rpDecId = rpId.
arm()*100 + rpId.station()*10 + rpId.rp();
122 rpPlots[rpDecId].fill(trk.getX(), trk.getY());
125 for (
const auto& t1 : *tracks) {
128 for (
const auto& t2 : *tracks) {
131 if (rpId1.arm() != rpId2.arm())
134 if (rpId1.station() == 0 && rpId2.station() == 2)
135 armPlots[rpId1.arm()].fill(t1.getX(), t1.getY(), t2.getX(), t2.getY());
144 auto f_out = std::make_unique<TFile>(
outputFile_.c_str(),
"recreate");
146 for (
const auto& it :
rpPlots) {
147 gDirectory = f_out->mkdir(Form(
"RP %u", it.first));
152 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)