#include "Cut.h" #include ClassImp(Cut) int parseNumber(int a, int b); // // initiatlize // NchCentrality Cut::mZdcCtbCent[2] = {kTotal,kFive}; Int_t Cut::mFlowCent[2] = {-1,-1}; Int_t Cut::mHMinusCent[2] = {-1,-1}; Int_t Cut::mNchCent[2] = {-1,1}; // set all to false as default. bool Cut::mDoFlowCent=false; bool Cut::mDoZdcCtbCent=false; bool Cut::mDoHMinusCent=false; bool Cut::mDoNchCent=false; bool Cut::mDoNchCentKludge=false; bool Cut::mDoSpectraCent=false; // default is not to use the spectra centrality Float_t Cut::mVertexZ[2] = {-200,200}; Float_t Cut::mVertexZSkip = 0; Float_t Cut::mEta[2] = {-.5,.5}; Int_t Cut::mFitPts[2] = {0,45}; Float_t Cut::mSDcaGl[2] = {-3,3}; Float_t Cut::mDcaPr[2] = {0,3}; Float_t Cut::mDcaXYGl[2] = {-3,3}; Int_t Cut::mMcPts[2] = {10,99}; Float_t Cut::mEtaTight[2] = { -.2, .2 }; Float_t Cut::mHitAvoid=0; Int_t Cut::mCut = 0; char Cut::mHalf = 0; char Cut::mHitHalf = 0; char Cut::mGeomHalf = 0; void Cut::SetHalf(char half) { switch(half){ case 'e' : mHalf = 'e'; mVertexZ[1] = 0; break; case 'w' : mHalf = 'w'; mVertexZ[0] = 0; break; case 's' : mHalf = 's'; break; // enforce same side default : cerr << "Wrong half " << half << endl; exit(1); } } void Cut::SetHitHalf(char half) { switch(half){ case 'e' : mHitHalf = 'e'; break; case 'w' : mHitHalf = 'w'; break; case 's' : mHitHalf = 's'; break; default : cerr << "Wrong hit half " << half << endl; exit(1); } } void Cut::SetGeomHalf(char half) { switch(half){ case 'e' : mGeomHalf = 'e'; break; case 'w' : mGeomHalf = 'w'; break; case 's' : mGeomHalf = 's'; break; default : cerr << "Wrong geom half " << half << endl; exit(1); } } /* Cuts defined as : a. centrality 9=minbias 8=central 7=peripheral 6=central (version 2 (uses 5% hminus cut for other)) 5=peripheral kludge (use 50-80 for corrections) 4=10-20% 3=20-30% 2=30-40% 1=40-60% b. which centrality definition for spectra 9=flow 8=zdc-ctb 7=hminus 6=nch c. which centrality definition for corrections/other 9=flow 8=zdc-ctb 7=hminus 6=nch d. vertex 9=-200,200 8=-75,75 7=-95,95 6=-30,30 5=0,30 e. half? 9=none 8=hit avoid CM 7=hit avoid 10 cm around CM f. fit pts 9=20-45 8=25 7=10 6=35 // really tight 5=24 4=23 3=30 g. dca 3d 9=1 8=1.2 7=3 h. eta 9=.5 8=.7 7= >0, <.5 */ /* e.g. a=15796, b=5 : return = 1 a=5924, b=3 : return = 9, etc. */ int parseNumber(int a, int b) { int div1=(int)pow(10,b); int div2=(int)pow(10,b-1); int val=a%div1; return (val==a) ? int(a/div2) : int(val/div2); } void Cut::SetCut(Int_t type) { if(type<10000000){ cout << "type " << type << " is too short" << endl;exit(1); } mCut=type; int centType=parseNumber(type,8); int centDefSpectra=parseNumber(type,7); int centDefOther=parseNumber(type,6); int vertex=parseNumber(type,5); int half=parseNumber(type,4); int fitPts=parseNumber(type,3); int dca=parseNumber(type,2); int eta=parseNumber(type,1); cout << "Set cut?" << endl << "\tcentType=" << centType << endl << "\tcentDefSpectra=" << centDefSpectra << endl << "\tcentDefOther=" << centDefOther << endl << "\tvertex=" << vertex << endl << "\thalf=" << half << endl << "\tfitPts=" << fitPts << endl << "\tdca=" << dca << endl << "\teta=" << eta << endl; // list the peripheral definitions here for convenience NchCentrality peripheralMin = kEighty, peripheralMax = kSeventy; NchCentrality kludgeMin = kEighty, kludgeMax = kSixty; //NchCentrality kludge2Min = kEighty, // kludge2Max = kSixty; switch(centType){ case 9: // minbias if(mDoSpectraCent){ if(centDefSpectra==9){ // flow mFlowCent[0]=0; mFlowCent[1]=9; mDoFlowCent=true; } else if(centDefSpectra==8){ // zdc-ctb mZdcCtbCent[0]=kTotal; mZdcCtbCent[1]=kFive; mDoZdcCtbCent=true; } else if(centDefSpectra==7){ // hminus mHMinusCent[0]=kTotal; mHMinusCent[1]=kFive; mDoHMinusCent=true; } else if(centDefSpectra==6){ // nch mNchCent[0]=kTotal; mNchCent[1]=kFive; mDoNchCent=true; } else if(centDefSpectra==5){ // nch mNchCent[0]=kTotal; mNchCent[1]=kFive; mDoNchCentKludge=true; } else{ cerr << "unknown centrality definition for spectra " << centDefSpectra<