1 #ifndef SimPPS_RPIXDigiAnalyzer_h 2 #define SimPPS_RPIXDigiAnalyzer_h 31 #define SELECTED_PIXEL_ROW 89 32 #define SELECTED_PIXEL_COLUMN 23 33 #define SELECTED_UNITID 2014314496 34 #define TG184 0.332655724 36 #define USE_MIDDLE_OF_PIXEL_2 38 #define CENTERY -8.475 55 void endJob()
override;
74 unsigned int cumulative_cluster_size_[3];
79 hOneHitperEvent(nullptr),
80 hOneHitperEvent2(nullptr),
81 hOneHitperEventCenter(nullptr),
82 hOneHitperEvent2Center(nullptr) {
83 label_ =
pset.getUntrackedParameter<
string>(
"label");
86 #ifdef USE_MIDDLE_OF_PIXEL 87 hOneHitperEvent =
file->make<TH2D>(
"OneHitperEvent",
"One Hit per Event", 30, -8.511, -8.361, 20, 1, 1.1);
88 hOneHitperEvent2 =
file->make<TH2D>(
"OneHitperEvent2",
"One Hit per Event 2", 30, -8.511, -8.361, 20, 1, 1.1);
90 hOneHitperEvent =
file->make<TH2D>(
"OneHitperEvent",
"One Hit per Event", 30, -8.55, -8.4, 20, 1, 1.1);
91 hOneHitperEvent2 =
file->make<TH2D>(
"OneHitperEvent2",
"One Hit per Event 2", 30, -8.55, -8.4, 20, 1, 1.1);
93 file->make<TH2D>(
"OneHitperEventCenter",
"One Hit per Event Center", 30, -0.075, 0.075, 20, -0.05, 0.05);
95 file->make<TH2D>(
"OneHitperEvent2Center",
"Cluster Size 2", 30, -0.075, 0.075, 20, -0.05, 0.05);
98 hAllHits =
file->make<TH2D>(
"AllHits",
"All Hits", 10, 1, 1.1, 10, -8.55, -8.4);
109 for (
int a = 0;
a < 3;
a++)
120 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
"--- Run: " <<
event.id().run() <<
" Event: " <<
event.id().event();
123 <<
" I do love Pixels ";
133 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
"\n=================== RPDA Starting SimHit access" 134 <<
" ===================";
139 double selected_pixel_lower_x;
140 double selected_pixel_lower_y;
141 double selected_pixel_upper_x;
142 double selected_pixel_upper_y;
148 selected_pixel_lower_x,
149 selected_pixel_upper_x,
150 selected_pixel_lower_y,
151 selected_pixel_upper_y);
153 double hit_inside_selected_pixel[2];
154 bool found_hit_inside_selected_pixel =
false;
159 LocalPoint midP((entryP.
x() + exitP.
x()) / 2., (entryP.
y() + exitP.
y()) / 2.);
161 #ifdef USE_MIDDLE_OF_PIXEL 162 if (entryP.
x() > selected_pixel_lower_x && entryP.
x() < selected_pixel_upper_x &&
163 entryP.
y() > (selected_pixel_lower_y + 0.115 *
TG184) && entryP.
y() < (selected_pixel_upper_y + 0.115 *
TG184)
166 if (midP.
x() > selected_pixel_lower_x && midP.
x() < selected_pixel_upper_x && midP.
y() > selected_pixel_lower_y &&
167 midP.
y() < selected_pixel_upper_y
169 if (entryP.
x() > selected_pixel_lower_x && entryP.
x() < selected_pixel_upper_x &&
170 entryP.
y() > selected_pixel_lower_y && entryP.
y() < selected_pixel_upper_y
174 hit_inside_selected_pixel[0] = entryP.
x();
175 hit_inside_selected_pixel[1] = entryP.
y();
176 found_hit_inside_selected_pixel =
true;
177 #ifdef USE_MIDDLE_OF_PIXEL_2 187 edm::LogInfo(
"PPSPixelDigiAnalyzer") << hit_inside_selected_pixel[0] <<
" " << hit_inside_selected_pixel[1];
193 if (
hit->timeOfFlight() > 0) {
195 <<
"DetId: " <<
hit->detUnitId() <<
"PID: " <<
hit->particleType() <<
" TOF: " <<
hit->timeOfFlight()
196 <<
" Proc Type: " <<
hit->processType() <<
" p: " <<
hit->pabs() <<
" x = " << entryP.
x()
197 <<
" y = " << entryP.
y() <<
" z = " << entryP.
z();
202 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
"\n=================== RPDA Starting Digi access" 203 <<
" ===================";
204 int numberOfDetUnits = 0;
209 for (; DSViter != CTPPSPixelDigis->end(); DSViter++) {
212 DetId detIdObject(DSViter->detId());
214 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
"DetId: " << DSViter->detId();
216 bool found_corresponding_digi =
false;
217 unsigned int corresponding_digi_cluster_size = 0;
224 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
"FF " << DSViter->detId();
226 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
" Digi row " << di->row() <<
", col " << di->column();
233 unsigned int rr = di->row();
234 unsigned int cc = di->column();
238 <<
" pixel boundaries x low up, y low up " << lx <<
" " << ux <<
" " << ly <<
" " << uy;
241 if (DSViter->detId() ==
SELECTED_UNITID && found_hit_inside_selected_pixel) {
244 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
" Digi row " << di->row() <<
", col " << di->column();
248 found_corresponding_digi =
true;
249 corresponding_digi_cluster_size = 1;
253 if (found_corresponding_digi) {
256 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
" Digi row " << di->row() <<
", col " << di->column();
262 corresponding_digi_cluster_size++;
263 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
" Digi row " << di->row() <<
", col " << di->column();
268 if (corresponding_digi_cluster_size > 0) {
270 <<
"corresponding_digi_cluster_size in the event: " << corresponding_digi_cluster_size;
273 if (corresponding_digi_cluster_size < 3) {
275 if (corresponding_digi_cluster_size > 1) {
288 edm::LogInfo(
"PPSPixelDigiAnalyzer") <<
"numberOfDetUnits in the event: " << numberOfDetUnits;
unsigned int cumulative_cluster_size_[3]
TH2D * hOneHitperEvent2Center
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned int found_corresponding_digi_count_
#define SELECTED_PIXEL_ROW
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > pixel_token
#define DEFINE_FWK_MODULE(type)
edm::ESGetToken< PPSPixelTopology, PPSPixelTopologyRcd > pixelTopologyToken_
void pixelRange(unsigned int arow, unsigned int acol, double &lower_x, double &higher_x, double &lower_y, double &higher_y) const
TH2D * hOneHitperEventCenter
Log< level::Info, false > LogInfo
#define SELECTED_PIXEL_COLUMN
edm::EDGetTokenT< edm::PSimHitContainer > psim_token
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
#define USE_MIDDLE_OF_PIXEL_2
PPSPixelDigiAnalyzer(const edm::ParameterSet &pset)
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
~PPSPixelDigiAnalyzer() override