73 static constexpr
int netamx = 30;
74 static constexpr
int nphimx = 72;
75 static constexpr
int ringmx = 5;
76 static constexpr
int ncut = 14;
78 const char* varcrit[3] = {
"All",
"steps",
"n-1"};
80 const double elosfact = (14.9 + 0.96 * fabs(
log(8 * 2.8)) + 0.033 * 8 * (1.0 -
pow(8, -0.33)));
82 int getHOieta(
int ij) {
return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; }
99 TH1F* ho_indenergy[netamx][nphimx];
114 TH2F* sig_eta_evt[3 * netamx][ncut];
115 TH2F* sigvsevt[3 * netamx][ncut];
116 TH1F* variab[3 * netamx][ncut];
118 TH2F* mu_projection[ncut + 1];
123 float inslumi, trkdr, trkdz, trkvx, trkvy,
trkvz, trkmm, trkth, trkph, chisq, therr, pherr, hodx, hody, hoang, htime,
124 hosig[9], hocorsig[18], hocro, hbhesig[9], caloen[3];
130 float ncount[ringmx][ncut + 10];
151 : m_cosmic(iConfig.getUntrackedParameter<
bool>(
"cosmic",
true)),
152 m_zeroField(iConfig.getUntrackedParameter<
bool>(
"zeroField",
false)),
153 m_bins(iConfig.getUntrackedParameter<
int>(
"HOSignalBins", 120)),
154 m_low(iConfig.getUntrackedParameter<double>(
"lowerRange", -1.0)),
155 m_ahigh(iConfig.getUntrackedParameter<double>(
"upperRange", 29.0)),
156 m_histFill(iConfig.getUntrackedParameter<
bool>(
"histFill",
true)),
157 m_treeFill(iConfig.getUntrackedParameter<
bool>(
"treeFill",
false)),
167 for (
int ij = 0; ij < 10; ij++) {
173 T1 =
fs->make<TTree>(
"T1",
"HOSignal");
175 T1->Branch(
"irun", &
irun,
"irun/I");
176 T1->Branch(
"ievt", &
ievt,
"ievt/i");
178 T1->Branch(
"isect", &
isect,
"isect/I");
179 T1->Branch(
"isect2", &
isect2,
"isect2/I");
180 T1->Branch(
"ndof", &
ndof,
"ndof/I");
181 T1->Branch(
"nmuon", &
nmuon,
"nmuon/I");
183 T1->Branch(
"ilumi", &
ilumi,
"ilumi/I");
185 T1->Branch(
"inslumi", &
inslumi,
"inslumi/F");
186 T1->Branch(
"nprim", &
nprim,
"nprim/I");
187 T1->Branch(
"tkpt03", &
tkpt03,
" tkpt03/F");
188 T1->Branch(
"ecal03", &
ecal03,
" ecal03/F");
189 T1->Branch(
"hcal03", &
hcal03,
" hcal03/F");
192 T1->Branch(
"trkdr", &
trkdr,
"trkdr/F");
193 T1->Branch(
"trkdz", &
trkdz,
"trkdz/F");
195 T1->Branch(
"trkvx", &
trkvx,
"trkvx/F");
196 T1->Branch(
"trkvy", &
trkvy,
"trkvy/F");
197 T1->Branch(
"trkvz", &
trkvz,
"trkvz/F");
198 T1->Branch(
"trkmm", &
trkmm,
"trkmm/F");
199 T1->Branch(
"trkth", &
trkth,
"trkth/F");
200 T1->Branch(
"trkph", &
trkph,
"trkph/F");
202 T1->Branch(
"chisq", &
chisq,
"chisq/F");
203 T1->Branch(
"therr", &
therr,
"therr/F");
204 T1->Branch(
"pherr", &
pherr,
"pherr/F");
205 T1->Branch(
"hodx", &
hodx,
"hodx/F");
206 T1->Branch(
"hody", &
hody,
"hody/F");
207 T1->Branch(
"hoang", &
hoang,
"hoang/F");
209 T1->Branch(
"momatho", &
momatho,
"momatho/F");
210 T1->Branch(
"hoflag", &
hoflag,
"hoflag/i");
211 T1->Branch(
"htime", &
htime,
"htime/F");
212 T1->Branch(
"hosig",
hosig,
"hosig[9]/F");
213 T1->Branch(
"hocro", &
hocro,
"hocro/F");
214 T1->Branch(
"hocorsig",
hocorsig,
"hocorsig[18]/F");
215 T1->Branch(
"caloen",
caloen,
"caloen[3]/F");
221 for (
int ij = 0; ij <
netamx; ij++) {
223 for (
int jk = 0; jk <
nphimx; jk++) {
224 sprintf(
name,
"ho_indenergy_%i_%i", ij, jk);
225 sprintf(
title,
"ho IndEnergy (GeV) i#eta=%i i#phi=%i",
ieta, jk + 1);
231 muonnm =
fs->make<TH1F>(
"muonnm",
"No of muon", 10, -0.5, 9.5);
232 muonmm =
fs->make<TH1F>(
"muonmm",
"P_{mu}", 200, -100., 100.);
233 muonth =
fs->make<TH1F>(
"muonth",
"{Theta}_{mu}", 180, 0., 180.);
234 muonph =
fs->make<TH1F>(
"muonph",
"{Phi}_{mu}", 180, -180., 180.);
235 muonch =
fs->make<TH1F>(
"muonch",
"{chi^2}/ndf", 100, 0., 1000.);
237 sel_muonnm =
fs->make<TH1F>(
"sel_muonnm",
"No of muon(sel)", 10, -0.5, 9.5);
238 sel_muonmm =
fs->make<TH1F>(
"sel_muonmm",
"P_{mu}(sel)", 200, -100., 100.);
239 sel_muonth =
fs->make<TH1F>(
"sel_muonth",
"{Theta}_{mu}(sel)", 180, 0., 180.);
240 sel_muonph =
fs->make<TH1F>(
"sel_muonph",
"{Phi}_{mu}(sel)", 180, -180., 180.);
241 sel_muonch =
fs->make<TH1F>(
"sel_muonch",
"{chi^2}/ndf(sel)", 100, 0., 1000.);
243 float pival = acos(-1.);
246 const char* varnam[
ncut] = {
"ndof",
260 int nbinxx[
ncut] = {25, 60, 60, 60, 60, 60, 60, 120, 6, 60, 60, 120, 120, 60};
261 double alowxx[
ncut] = {5.5, 0., 0., -pival, 0.0, 0.0, 0.0, 0., 0.5, 0.0, 0.0, -20., -32., -45.0};
262 double ahghxx[
ncut] = {30.5, 40., pival, pival, 0.8, 0.02, 0.5, 300., 6.5, 10.0, 24.0, 20.0, 32.0, 45.0};
264 for (
int kl = 0; kl <
ncut; kl++) {
265 for (
int jk = 0; jk < 3; jk++) {
266 for (
int ij = 0; ij <
netamx; ij++) {
267 sprintf(
name,
"sigeta_%i_%i_%i", kl, jk, ij);
275 for (
int kl = 0; kl <
ncut; kl++) {
276 for (
int ij = 0; ij <
ringmx * 3; ij++) {
277 int iring = ij %
ringmx - 2;
279 sprintf(
name,
"sigring_%i_%i", kl, ij);
280 sprintf(
title,
"Signal %s %s Ring%i", varnam[kl],
varcrit[iset], iring);
285 for (
int kl = 0; kl <
ncut; kl++) {
286 for (
int ij = 0; ij <
ringmx * 3; ij++) {
287 int iring = ij %
ringmx - 2;
289 sprintf(
name,
"varring_%i_%i", kl, ij);
290 sprintf(
title,
"%s %s Ring%i", varnam[kl],
varcrit[iset], iring);
291 variab[ij][kl] =
fs->make<TH1F>(
name,
title, nbinxx[kl], alowxx[kl], ahghxx[kl]);
295 for (
int ij = 0; ij <=
ncut; ij++) {
296 sprintf(
name,
"mu_projection_%i", ij);
298 sprintf(
title,
"All projected muon");
300 sprintf(
title,
"Projected muon with selection %s", varnam[ij - 1]);
306 for (
int ij = 0; ij < 31; ij++) {
309 for (
int ij = 0; ij <
ringmx; ij++) {
310 for (
int jk = 0; jk <
ncut + 10; jk++) {
321 <<
" " << setw(7) <<
nevents[2] <<
" " << setw(7) <<
nevents[3] <<
" " << setw(7)
322 <<
nevents[4] <<
" " << setw(7) <<
nevents[5] <<
" Selected events # is " 336 float pival = acos(-1.);
345 <<
" " << setw(7) <<
nevents[2] <<
" " << setw(7) <<
nevents[3] <<
" " 353 nmuon = (*HOCalib).size();
355 for (HOCalibVariableCollection::const_iterator hoC = (*HOCalib).begin(); hoC != (*HOCalib).end(); hoC++) {
356 trkdr = (*hoC).trkdr;
357 trkdz = (*hoC).trkdz;
359 trkvx = (*hoC).trkvx;
360 trkvy = (*hoC).trkvy;
361 trkvz = (*hoC).trkvz;
363 trkmm = (*hoC).trkmm;
364 trkth = (*hoC).trkth;
365 trkph = (*hoC).trkph;
368 chisq = (*hoC).chisq;
371 therr = (*hoC).therr;
372 pherr = (*hoC).pherr;
373 trkph = (*hoC).trkph;
376 nprim = (*hoC).nprim;
383 isect = (*hoC).isect;
387 hoang = (*hoC).hoang;
391 htime = (*hoC).htime;
393 for (
int ij = 0; ij < 9; ij++) {
394 hosig[ij] = (*hoC).hosig[ij];
399 for (
int ij = 0; ij < 18; ij++) {
405 hocro = (*hoC).hocro;
406 for (
int ij = 0; ij < 3; ij++) {
407 caloen[ij] = (*hoC).caloen[ij];
427 bool isZSps = (
hosig[4] < -99.0) ?
false :
true;
433 if (fabs(
trkth - pival / 2) < 0.000001)
445 int iring2 = iring + 2;
477 if (
pherr < 0.0002) {
481 if (abshoang > 0.60 && abshoang < 1.0) {
515 if (fabs(
hodx) < 100 && fabs(
hodx) > 2) {
520 if (fabs(
hody) < 100 && fabs(
hody) > 2) {
573 if (fabs(
trkth - pival / 2) < 21.5) {
577 if (fabs(
trkph + pival / 2) < 21.5) {
582 if (
therr < 0.00002) {
586 if (
pherr < 0.000002) {
601 if ((iring2 == 1 || iring2 == 3) && fabs(
momatho) > 17.0) {
605 if ((iring2 == 0 || iring2 == 4) && fabs(
momatho) > 20.0) {
637 if (fabs(
hodx) < 100 && fabs(
hodx) > 2) {
642 if (fabs(
hody) < 100 && fabs(
hody) > 2) {
932 if (abshoang > 0.01) {
950 if (abshoang > 0.01) {
985 int iselect = (ipsall ==
mypow_2[
ncut] - 1) ? 1 : 0;
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< HORecHitCollection > tok_allho_
const edm::EDGetTokenT< HOCalibVariableCollection > tok_ho_
#define DEFINE_FWK_MODULE(type)
HOCalibAnalyzer(const edm::ParameterSet &)
Sin< T >::type sin(const T &t)
void analyze(const edm::Event &, const edm::EventSetup &) override
static constexpr int ncut
TH1F * variab[3 *netamx][ncut]
TH1F * ho_indenergy[netamx][nphimx]
edm::InputTag hoCalibVariableCollectionTag
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
TH2F * sig_eta_evt[3 *netamx][ncut]
static constexpr int nphimx
static constexpr int ringmx
float ncount[ringmx][ncut+10]
Abs< T >::type abs(const T &t)
int invert_HOieta(int ieta)
std::vector< HOCalibVariables > HOCalibVariableCollection
collection of HOcalibration variabale
static constexpr int netamx
TH2F * sigvsevt[3 *netamx][ncut]
~HOCalibAnalyzer() override
TH2F * mu_projection[ncut+1]
Power< A, B >::type pow(const A &a, const B &b)