28 #include "StFmsDiPi0.h"
30 #include "StMessMgr.h"
32 #include "StMuDSTMaker/COMMON/StMuTypes.hh"
34 #include "StThreeVectorF.hh"
35 #include "StFmsDbMaker/StFmsDbMaker.h"
38 #include "StEvent/StEvent.h"
39 #include "StEvent/StFmsCollection.h"
40 #include "StEvent/StFmsHit.h"
41 #include "StEvent/StFmsPoint.h"
42 #include "StEvent/StFmsPointPair.h"
43 #include "StEvent/StTriggerData.h"
45 #include "StSpinPool/StFmsFastSimMaker/StFmsFastSimMaker.h"
54 static const double PI=TMath::Pi();
55 static const double twoPI=PI*2.0;
57 const float mPtBin[7]={0.5,1.0,1.5,2.0,2.5,3.0,4.0};
58 const float energyCut=1.0;
59 const float ptCut=0.1;
60 const float ZggCut=0.7;
61 const float MassCut0=0.07;
62 const float MassCut1=0.2;
63 const float MassCut2=0.35;
65 static const int NTRG=12;
66 static const char *CTRG[NTRG] = {
"SmBS1",
"SmBS2",
"SmBS3",
"LgBS1",
67 "LgBS2",
"LgBS3",
"DiBS" ,
"JP2",
68 "JP1" ,
"JP0" ,
"DiJP" ,
"LED"};
70 static const short MAXP=256;
72 unsigned short tTRG,tBBCE,tZDCE;
73 unsigned char tBC, tBBCM, tTOFM, tNP;
74 unsigned char tDet[MAXP];
75 unsigned short tId[MAXP];
76 float tX[MAXP], tY[MAXP];
77 float tPx[MAXP], tPy[MAXP], tPz[MAXP], tE[MAXP];
79 int getFmsTrigId(
const StTriggerId& trgid,
int print=0){
80 const int TIDBASE=480800;
82 const int MAXVERSION=3;
84 if(print) LOG_INFO <<
"TRGID = ";
85 for(
int k=0; k<NBEAM; k++){
86 for(
int j=0; j<MAXVERSION; j++){
87 for(
int i=1; i<=NTRG; i++){
90 int id=TIDBASE + 10000*k + 20*j + l;
91 if(trgid.isTrigger(
id)){
93 if(print)LOG_INFO << CTRG[i-1] <<
" ";
98 if(print) LOG_INFO << endm;
102 double wrapAround(
double phi){
104 while(res>=1.5*PI) {res-=twoPI;}
105 while(res<-0.5*PI) {res+=twoPI;}
111 StFmsDiPi0::StFmsDiPi0(
const Char_t* name):
112 StMaker(name),mFilename((char *)
"fmsDiPi0.root") {}
114 StFmsDiPi0::~StFmsDiPi0(){}
116 Int_t StFmsDiPi0::Init(){
117 if(!mReadTree && !mPythia){
118 mFmsDbMaker=
static_cast<StFmsDbMaker*
>(GetMaker(
"fmsDb"));
120 LOG_ERROR <<
"StFmsDiPi0::InitRun Failed to get StFmsDbMaker" << endm;
126 mFile=
new TFile(mFilename,
"RECREATE");
128 mBC=
new TH1F(
"BC",
"BC",120,0.0,120.0);
129 mBBC=
new TH1F(
"BBCE",
"BBCE",100,0.0,70000.0);
130 mBBCAG=
new TH1F(
"BBCEAG",
"BBCEAG",100,0.0,70000.0);
131 mBBCM=
new TH1F(
"BBCMult",
"BBCMult",17,0.0,17.0);
132 mBBCMAG=
new TH1F(
"BBCMultAG",
"BBCMultAG",17,0.0,17.0);
133 mTOF=
new TH1F(
"TOF",
"TOF",150,0.0,300.0);
134 mTOFAG=
new TH1F(
"TOFAG",
"TOFAG",150,0.0,300.0);
135 mBBCTOF=
new TH2F(
"BBC_TOF",
"BBC_TOF",50,0.0,70000.0,50,0.0,300.0);
136 mBBCMTOF=
new TH2F(
"BBCMult_TOF",
"BBCMult_TOF",17,0.0,17.0,50,0.0,300.0);
137 mBBCBBCM=
new TH2F(
"BBC_BBCMult",
"BBC_BBCMult",50,0.0,70000.0,17,0.0,17.0);
138 mTOFTOF=
new TH2F(
"TOF_TOF",
"TOF_TOF",50,0.0,300.0,50,0.0,300.0);
140 mMass0=
new TH2F(
"Mass0",
"Mass0",50,0.0, 0.4,16,0.0,16.0);
141 mMass1=
new TH2F(
"Mass1",
"Mass1",50,0.0, 0.4,16,0.0,16.0);
142 mMass2=
new TH2F(
"Mass2",
"Mass2",50,0.0, 0.4,16,0.0,16.0);
143 mEne =
new TH2F(
"Ene",
"Ene", 50,0.0,100.0,16,0.0,16.0);
144 mPt =
new TH2F(
"pT",
"pT", 50,0.0, 10.0,16,0.0,16.0);
146 for(
int i=0; i<kNPtBin; i++){
147 for(
int j=0; j<=i; j++){
148 for(
int k=0; k<=kNCut; k++){
150 sprintf(c,
"m0_%1d_c%d",i,k); mM0[i][k]=
new TH1F(c,c,50,0.0,0.4);
151 sprintf(c,
"phi0_%1d_c%d",i,k); mPhi0[i][k]=
new TH1F(c,c,128,-0.5*PI,1.5*PI);
152 sprintf(c,
"etaphi0_%1d_c%d",i,k); mEtaPhi0[i][k]=
new TH2F(c,c,50,2.5,4.5,64,-0.5*PI,1.5*PI);
154 sprintf(c,
"m1_%1d%1d_c%d",i,j,k); mM1[i][j][k]=
new TH1F(c,c,50,0.0,0.4);
155 sprintf(c,
"m2_%1d%1d_c%d",i,j,k); mM2[i][j][k]=
new TH1F(c,c,50,0.0,0.4);
156 sprintf(c,
"z1_%1d%1d_c%d",i,j,k); mZ1[i][j][k]=
new TH1F(c,c,50,0.0,1.0);
157 sprintf(c,
"z2_%1d%1d_c%d",i,j,k); mZ2[i][j][k]=
new TH1F(c,c,50,0.0,1.0);
158 sprintf(c,
"e1_%1d%1d_c%d",i,j,k); mE1[i][j][k]=
new TH1F(c,c,50,0.0,100.0);
159 sprintf(c,
"e2_%1d%1d_c%d",i,j,k); mE2[i][j][k]=
new TH1F(c,c,50,0.0,100.0);
160 sprintf(c,
"pt1_%1d%1d_c%d",i,j,k); mPt1[i][j][k]=
new TH1F(c,c,50,0.0,10.0);
161 sprintf(c,
"pt2_%1d%1d_c%d",i,j,k); mPt2[i][j][k]=
new TH1F(c,c,50,0.0,10.0);
162 sprintf(c,
"eta1_%1d%1d_c%d",i,j,k); mEta1[i][j][k]=
new TH1F(c,c,50,2.0,5.0);
163 sprintf(c,
"eta2_%1d%1d_c%d",i,j,k); mEta2[i][j][k]=
new TH1F(c,c,50,2.0,5.0);
164 sprintf(c,
"phi1_%1d%1d_c%d",i,j,k); mPhi1[i][j][k]=
new TH1F(c,c,128,-0.5*PI,1.5*PI);
165 sprintf(c,
"phi2_%1d%1d_c%d",i,j,k); mPhi2[i][j][k]=
new TH1F(c,c,128,-0.5*PI,1.5*PI);
166 sprintf(c,
"dphi_%1d%1d_c%d",i,j,k); mDphi[i][j][k]=
new TH1F(c,c,128,-0.5*PI,1.5*PI);
167 sprintf(c,
"bbce_%1d%1d_c%d",i,j,k); mBbce[i][j][k]=
new TH1F(c,c,50,0.0,70000.0);
168 sprintf(c,
"tofm_%1d%1d_c%d",i,j,k); mTofm[i][j][k]=
new TH1F(c,c,50,0.0,250.0);
169 sprintf(c,
"phi1dphi_%1d%1d_c%d",i,j,k); mPhi1Dphi[i][j][k]=
new TH2F(c,c,50,-0.5*PI,1.5*PI,50,-0.5*PI,1.5*PI);
176 mTreeFile=
new TFile(mTreeFilename,
"recreate");
177 mTree=
new TTree(
"dipi0",
"dipi0 tree");
178 mTree->Branch(
"trg",&tTRG,
"trg/s");
179 mTree->Branch(
"bbce",&tBBCE,
"bbce/s");
180 mTree->Branch(
"zdce",&tZDCE,
"zdce/s");
181 mTree->Branch(
"bc",&tBC,
"bc/b");
182 mTree->Branch(
"bbcm",&tBBCM,
"bbcm/b");
183 mTree->Branch(
"tofm",&tTOFM,
"tofm/b");
184 mTree->Branch(
"np",&tNP,
"np/b");
185 mTree->Branch(
"det",tDet,
"det[np]/b");
186 mTree->Branch(
"id",tId,
"id[np]/s");
187 mTree->Branch(
"e",tE,
"e[np]/F");
188 mTree->Branch(
"x",tX,
"x[np]/F");
189 mTree->Branch(
"y",tY,
"y[np]/F");
190 mTree->Branch(
"px",tPx,
"px[np]/F");
191 mTree->Branch(
"py",tPy,
"py[np]/F");
192 mTree->Branch(
"pz",tPz,
"pz[np]/F");
200 mChain->SetBranchAddress(
"trg",&tTRG);
201 mChain->SetBranchAddress(
"bbce",&tBBCE);
202 mChain->SetBranchAddress(
"zdce",&tZDCE);
203 mChain->SetBranchAddress(
"bc",&tBC);
204 mChain->SetBranchAddress(
"bbcm",&tBBCM);
205 mChain->SetBranchAddress(
"tofm",&tTOFM);
206 mChain->SetBranchAddress(
"np",&tNP);
207 mChain->SetBranchAddress(
"det",tDet);
208 mChain->SetBranchAddress(
"id",tId);
209 mChain->SetBranchAddress(
"e",tE);
210 mChain->SetBranchAddress(
"x",tX);
211 mChain->SetBranchAddress(
"y",tY);
212 mChain->SetBranchAddress(
"px",tPx);
213 mChain->SetBranchAddress(
"py",tPy);
214 mChain->SetBranchAddress(
"pz",tPz);
222 LOG_INFO << Form(
"Writing and Closing %s",mFilename) << endm;
226 LOG_INFO << Form(
"Writing and Closing %s",mTreeFilename) << endm;
234 Int_t StFmsDiPi0::ptbin(
float pt){
235 if(pt < mPtBin[0])
return -1;
236 for(
int i=0; i<kNPtBin; i++){
237 if(pt >= mPtBin[i] && pt < mPtBin[i+1])
return i;
244 int ag=0, bbcEsum=0, zdce=0, bbcmult=0, tofmul1=0, tofmul2=0, bsTrg=0, bsSTrg=0, bsLTrg=0, jetTrg=0, doubleTrg=0;
245 int bunch=-1, trigger=-1;
252 static unsigned int ievt=0;
255 int ret=mChain->GetEntry(ievt++);
266 if(!mudst) {LOG_ERROR <<
"StFmsDiPi0::Make did not find MuDst"<<endm;
return kStErr;}
268 if(!mueve) {LOG_ERROR <<
"StFmsDiPi0::Make did not find MuEvent"<<endm;
return kStErr;}
270 if(!trgd) {LOG_ERROR <<
"StFmsDiPi0::Make did not find StTriggerData from MuDst"<<endm;
return kStErr;}
272 bunch = trgd->bunchId7Bit();
274 for(
int i=1; i<=16; i++){
275 int tac=trgd->bbcTDC(east,i);
276 if(tac>100 && tac<2400){
277 int adc=trgd->bbcADC(east,i);
278 if(adc>50) bbcmult++;
279 bbcEsum += trgd->bbcADC(east,i);
282 zdce=trgd->zdcAttenuated(east);
283 tofmul1=trgd->tofMultiplicity();
284 tofmul2=mudst->
event()->btofTrayMultiplicity();
286 trigger = getFmsTrigId(mudst->
event()->triggerIdCollection().nominal());
288 LOG_INFO << Form(
"Run=%8d Event=%10d",mueve->runNumber(),mueve->eventNumber())<<endm;
290 if (bunch>=30 && bunch< 40) {ag=1;}
291 else if(bunch>=110 && bunch<120) {ag=2;}
292 else if(bbcmult==0 || tofmul2<3) {ag=3;}
293 if(trigger & 0x03f) bsTrg=1;
294 if(trigger & 0x007) bsSTrg=1;
295 if(trigger & 0x038) bsLTrg=1;
296 if(trigger & 0x380) jetTrg=1;
297 if(trigger & 0x440) doubleTrg=1;
300 mBC->Fill(
float(bunch));
302 mBBC->Fill(
float(bbcEsum));
303 mBBCM->Fill(
float(bbcmult));
304 mTOF->Fill(
float(tofmul2));
306 mBBCAG->Fill(
float(bbcEsum));
307 mBBCMAG->Fill(
float(bbcmult));
308 mTOFAG->Fill(
float(tofmul2));
310 mBBCTOF->Fill(bbcEsum,tofmul2);
311 mBBCMTOF->Fill(bbcmult,tofmul2);
312 mBBCBBCM->Fill(bbcEsum,bbcmult);
313 mTOFTOF->Fill(tofmul1,tofmul2);
316 LOG_INFO << Form(
"Bunch=%3d AGap=%1d BbcEsum=%6d Tof=%6d | %6d",
317 bunch,ag,bbcEsum,tofmul1,tofmul2) << endm;
321 StPtrVecFmsPoint pcut;
324 for(
int i=0; i<np; i++){
326 point->setDetectorId(tDet[i]);
327 point->setId(tId[i]);
328 point->setEnergy(tE[i]);
332 pcut.push_back(point);
336 if(!event) {LOG_ERROR <<
"StFmsDiPi0::Make did not find StEvent"<<endm;
return kStErr;}
337 mFmsColl =
event->fmsCollection();
338 if(!mFmsColl) {LOG_ERROR <<
"StFmsDiPi0::Make did not find StEvent->FmsCollection"<<endm;
return kStErr;}
339 StSPtrVecFmsPoint &points = mFmsColl->points();
340 np=mFmsColl->numberOfPoints();
341 if(print) cout << Form(
"Npoint = %d",np) << endl;
343 for(
int i=0; i<np; i++){
346 if(mPythia || distance<-0.51 || (mFmsColl->isMergeSmallToLarge() && edgeType==4)){
347 if(mPythia || (points[i]->energy()>energyCut && points[i]->fourMomentum().perp()>ptCut)){
348 pcut.push_back(points[i]);
354 if(print) cout << Form(
"Ncut = %d",pcut.size()) << endl;
358 return b->fourMomentum().perp() < a->fourMomentum().perp();
361 vector<StFmsPointPair*> pair;
362 std::vector<int> pcutuse(pcut.size(), 0);
363 for(
unsigned int i=0; i<pcut.size()-1; i++){
364 for(
unsigned int j=i+1; j<pcut.size(); j++){
366 if(mPythia || (pp->zgg() < ZggCut && pp->pT() > mPtBin[0])){
375 if(print) cout << Form(
"Npair = %d",pair.size()) << endl;
388 for(
unsigned int i=0; i<pcut.size(); i++){
390 tDet[i]=pcut[i]->detectorId();
391 tId[i]=pcut[i]->id();
392 tE[i]=pcut[i]->energy();;
395 tPx[i]=pcut[i]->fourMomentum().px();
396 tPy[i]=pcut[i]->fourMomentum().py();
397 tPz[i]=pcut[i]->fourMomentum().pz();
406 return b->pT() < a->pT();
409 for(
unsigned int i=0; i<pair.size(); i++){
410 LOG_INFO << Form(
"%3d m=%6.3f e=%6.2f pt=%6.2f eta=%6.2f phi=%6.3f zgg=%6.3f id=%4d %4d",
412 pair[i]->mass(), pair[i]->energy(),pair[i]->pT(),
413 pair[i]->eta(), pair[i]->phi(), pair[i]->zgg(),
414 pair[i]->point(0)->
id(), pair[i]->point(1)->
id() ) << endm;
420 int used1[2000],used2[2000],used3[2000],used4[2000];
421 memset(used1,0,
sizeof(used1));
422 memset(used2,0,
sizeof(used2));
423 memset(used3,0,
sizeof(used3));
424 memset(used4,0,
sizeof(used4));
426 for(
unsigned int i=0; i<pair.size(); i++){
427 int ptbin0=ptbin(pair[i]->pT());
428 if(ptbin0<0)
continue;
430 int id0=pair[i]->point(0)->id();
431 int id1=pair[i]->point(1)->id();
432 float m0=pair[i]->mass();
433 float z0=pair[i]->zgg();
434 float p0=wrapAround(pair[i]->phi());
436 if(p0>=0.0 && p0<PI) topbot=0;
440 while(pp<0.0) pp+=twoPI;
441 while(pp>=twoPI) pp-=twoPI;
442 int ii=int(8.0*pp/twoPI);
443 int dd=pair[i]->point(0)->detectorId();
444 if(dd==kFmsNorthSmallDetId || dd==kFmsSouthSmallDetId) ii+=8;
445 mMass0->Fill(m0,
float(ii));
446 if(pair[i]->pT()>1.5) mMass1->Fill(m0,
float(ii));
447 if(pair[i]->energy()>30.0) mMass2->Fill(m0,
float(ii));
448 if(m0>=MassCut0 && m0<MassCut1){
449 mEne->Fill(pair[i]->energy(),
float(ii));
450 mPt->Fill(pair[i]->pT(),
float(ii));
453 if(ptbin0>=kNPtBin)
continue;
455 memset(cut1,0,
sizeof(cut1));
459 if(m0>=MassCut0 && m0<MassCut1) {masscut1=1;}
460 else if(m0>=MassCut1 && m0<MassCut2) {masscut1=2;}
463 int exclusive1=0, exclusive2=0, exclusive3=0, exclusive4=0;
464 if(masscut1==1 && ((used1[id0]==0 && used1[id1]==0) || (used1[id0]==id1 && used1[id1]==id0))) {exclusive1=1; used1[id0]=id1; used1[id1]=id0;}
465 if(masscut1==1 && ((used2[id0]==0 && used2[id1]==0) || (used2[id0]==id1 && used2[id1]==id0))) {exclusive2=1; used2[id0]=id1; used2[id1]=id0;}
466 if(masscut1==2 && ((used3[id0]==0 && used3[id1]==0) || (used3[id0]==id1 && used3[id1]==id0))) {exclusive3=1; used3[id0]=id1; used3[id1]=id0;}
467 if(masscut1==2 && ((used4[id0]==0 && used4[id1]==0) || (used4[id0]==id1 && used4[id1]==id0))) {exclusive4=1; used4[id0]=id1; used4[id1]=id0;}
470 if(ag==0 && bsTrg==1){
476 if (bbcEsum<mBBCCut1) {cut1[3]=1;}
477 else if(bbcEsum<mBBCCut2) {cut1[4]=1;}
478 else if(bbcEsum<mBBCCut3) {cut1[5]=1;}
479 else if(bbcEsum<mBBCCut4) {cut1[15]=1;}
484 if(ag==1 && bsTrg==1 && exclusive1) cut1[6]=1;
485 if(ag==3 && bsTrg==1 && exclusive1) cut1[17]=1;
486 if(ag==0 && jetTrg==1 && exclusive1) cut1[7]=1;
487 if(ag==0 && doubleTrg==1 && exclusive1) cut1[8]=1;
488 if(ag==0 && bsTrg==1 && exclusive2) cut1[9]=1;
489 if(ag==0 && bsTrg==1 && exclusive3) cut1[10]=1;
490 if(ag==0 && bsTrg==1 && exclusive4) cut1[11]=1;
491 if(ag==0 && bsSTrg==1 && exclusive1) cut1[12]=1;
492 if(ag==0 && bsLTrg==1 && exclusive1) cut1[13]=1;
493 if(ag==0 && bsTrg==1 && exclusive1 && firstpair==0) cut1[14]=1;
494 if(ag==0 && bsTrg==1 && exclusive1 && topbot==0) cut1[18]=1;
495 if(ag==0 && bsTrg==1 && exclusive1 && topbot==1) cut1[19]=1;
497 for(
unsigned int k=0; k<kNCut; k++){
499 mM0[ptbin0][k]->Fill(m0);
500 mPhi0[ptbin0][k]->Fill(p0);
501 mEtaPhi0[ptbin0][k]->Fill(pair[i]->eta(),p0);
505 for(
unsigned int j=i+1; j<pair.size(); j++){
507 int ptbin1=ptbin(pair[j]->pT());
508 if(ptbin1<0)
continue;
509 int id2=pair[j]->point(0)->id();
510 int id3=pair[j]->point(1)->id();
511 if(id0==id2 || id0==id3 || id1==id2 || id1==id3)
continue;
512 float dphi = wrapAround(pair[i]->phi() - pair[j]->phi());
513 float m1=pair[j]->mass();
514 float z1=pair[j]->zgg();
515 float p1=wrapAround(pair[j]->phi());
517 memset(cut2,0,
sizeof(cut2));
519 if (m1>=MassCut0 && m1<MassCut1) {masscut2=1;}
520 else if(m1>=MassCut1 && m1<MassCut2) {masscut2=2;}
522 int exc1=0,exc2=0, exc3=0, exc4=0;
523 if(masscut2==1 && exclusive1 &&
524 ((used1[id2]==0 && used1[id3]==0) || (used1[id2]==id3 && used1[id3]==id2)) ){
525 used1[id2]=id3; used1[id3]=id2;
528 if(masscut2==2 && exclusive2 &&
529 ((used2[id2]==0 && used2[id3]==0) || (used2[id2]==id3 && used2[id3]==id2)) ){
530 used1[id2]=id3; used2[id3]=id2;
533 if(masscut2==1 && exclusive3 &&
534 ((used3[id2]==0 && used3[id3]==0) || (used3[id2]==id3 && used3[id3]==id2)) ){
535 used3[id2]=id3; used3[id3]=id2;
538 if(masscut2==2 && exclusive4 &&
539 ((used4[id2]==0 && used4[id3]==0) || (used4[id2]==id3 && used4[id3]==id2)) ){
540 used4[id2]=id3; used4[id3]=id2;
544 if(ag==0 && bsTrg==1){
550 if (bbcEsum<mBBCCut1) {cut2[3]=1;}
551 else if(bbcEsum<mBBCCut2) {cut2[4]=1;}
552 else if(bbcEsum<mBBCCut3) {cut2[5]=1;}
553 else if(bbcEsum<mBBCCut4) {cut2[15]=1;}
558 if(ag==1 && bsTrg==1 && exc1) cut2[6]=1;
559 if(ag==3 && bsTrg==1 && exc1) cut2[17]=1;
560 if(ag==0 && jetTrg==1 && exc1) cut2[7]=1;
561 if(ag==0 && doubleTrg==1 && exc1) cut2[8]=1;
562 if(ag==0 && bsTrg==1 && exc2) cut2[9]=1;
563 if(ag==0 && bsTrg==1 && exc3) cut2[10]=1;
564 if(ag==0 && bsTrg==1 && exc4) cut2[11]=1;
565 if(ag==0 && bsSTrg==1 && exc1) cut2[12]=1;
566 if(ag==0 && bsLTrg==1 && exc1) cut2[13]=1;
567 if(ag==0 && bsTrg==1 && exc1 && firstpair==0) {firstpair=1;cut2[14]=1;}
568 if(ag==0 && bsTrg==1 && exc1 && topbot==0) cut2[18]=1;
569 if(ag==0 && bsTrg==1 && exc1 && topbot==1) cut2[19]=1;
572 for(
unsigned int k=0; k<kNCut; k++){
574 mM1[ptbin0][ptbin1][k]->Fill(m0);
575 mM2[ptbin0][ptbin1][k]->Fill(m1);
576 mZ1[ptbin0][ptbin1][k]->Fill(z0);
577 mZ2[ptbin0][ptbin1][k]->Fill(z1);
578 mE1[ptbin0][ptbin1][k]->Fill(pair[i]->energy());
579 mE2[ptbin0][ptbin1][k]->Fill(pair[j]->energy());
580 mPt1[ptbin0][ptbin1][k]->Fill(pair[i]->pT());
581 mPt2[ptbin0][ptbin1][k]->Fill(pair[j]->pT());
582 mEta1[ptbin0][ptbin1][k]->Fill(pair[i]->eta());
583 mEta2[ptbin0][ptbin1][k]->Fill(pair[j]->eta());
584 mPhi1[ptbin0][ptbin1][k]->Fill(p0);
585 mPhi2[ptbin0][ptbin1][k]->Fill(p1);
586 mDphi[ptbin0][ptbin1][k]->Fill(dphi);
587 mBbce[ptbin0][ptbin1][k]->Fill(bbcEsum);
588 mPhi1Dphi[ptbin0][ptbin1][k]->Fill(p0,dphi);
591 if(print) LOG_INFO << Form(
"diPair=%3d pair=%2d %2d dphi=%6.3f ptbin=%1d %1d masscut=%1d ag=%1d exc=%1d",
592 ndipi0,i,j,dphi,ptbin0,ptbin1,masscut2,ag,exclusive2)<<endm;
597 for(
unsigned int i=0; i<pair.size(); i++)
delete pair[i];
600 for(
unsigned int i=0; i<pcut.size(); i++)
delete pcut[i];
607 LOG_ERROR <<
"Did not find FmsFastSimMaker!!!" << endm;
610 int n=fmssim->nPi0();
612 for(
int i=0; i<n; i++){
613 int ptbin0=ptbin(fmssim->pi0(i)->perp());
614 if(ptbin0<0)
continue;
615 mM0[ptbin0][kNCut]->Fill(0.135);
617 cout << Form(
"RealPi0 n=%2d pt=%6.2f eta=%6.2f phi=%6.3f",
618 n,fmssim->pi0(i)->perp(),
619 fmssim->pi0(i)->pseudoRapidity(),fmssim->pi0(i)->phi())<<endl;
620 for(
int j=i+1; j<n; j++){
622 int ptbin1=ptbin(fmssim->pi0(j)->perp());
623 if(ptbin1<0)
continue;
624 float phi1=wrapAround(fmssim->pi0(i)->phi());
625 float phi2=wrapAround(fmssim->pi0(j)->phi());
626 float dphi=wrapAround(phi1-phi2);
627 mM1[ptbin0][ptbin1][kNCut]->Fill(0.135);
628 mM2[ptbin0][ptbin1][kNCut]->Fill(0.135);
629 mPt1[ptbin0][ptbin1][kNCut]->Fill(fmssim->pi0(i)->perp());
630 mPt2[ptbin0][ptbin1][kNCut]->Fill(fmssim->pi0(j)->perp());
631 mE1[ptbin0][ptbin1][kNCut]->Fill(fmssim->pi0(i)->e());
632 mE2[ptbin0][ptbin1][kNCut]->Fill(fmssim->pi0(j)->e());
633 mEta1[ptbin0][ptbin1][kNCut]->Fill(fmssim->pi0(i)->pseudoRapidity());
634 mEta2[ptbin0][ptbin1][kNCut]->Fill(fmssim->pi0(j)->pseudoRapidity());
635 mPhi1[ptbin0][ptbin1][kNCut]->Fill(phi1);
636 mPhi2[ptbin0][ptbin1][kNCut]->Fill(phi2);
637 mDphi[ptbin0][ptbin1][kNCut]->Fill(dphi);
638 if(print) LOG_INFO << Form(
"RealPi0Pair %d %d dphi=%6.3f",i,j,dphi) << endm;
Float_t distanceFromEdge(Int_t det, Float_t x, Float_t y, int &edge)
get 4 vector assuing m=0 and taking beamline from DB
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)