/*:>-------------------------------------------------------------------- **: FILE: mMvdHst.cc **: HISTORY: **: 00jan93-v000a-hpl- Created by stic Version **: Id: idl.y,v 1.17 1997/03/25 19:22:52 ward Exp **:<------------------------------------------------------------------*/ #include "mMvdHst.h" #include #include "PhHistogramFactory.hh" #include #include #include #include #include #include #include void CalculateMips( TABLE_HEAD_ST *bRaw_h, DMVBRAW_ST *bRaw , TABLE_HEAD_ST *cRaw_h, DMVCRAW_ST *cRaw , DMVDPAR_ST *Par , float *mip ); #define MAX_SINGLE_EV_OUT 10 /* N dN/deta hists for single events */ #define ETA_MIN_HIST -7. /* min eta in histograms */ #define ETA_MAX_HIST 7. /* max eta in histograms */ #define N_ETA_BINS_IN_HIST 56 /* number of eta bins in histograms */ #define LOUD 3 long mMvdHst_( TABLE_HEAD_ST *Geo_h, DMVDGEO_ST *Geo , TABLE_HEAD_ST *Head_h, HEADER_ST *Head , TABLE_HEAD_ST *Par_h, DMVDPAR_ST *Par , TABLE_HEAD_ST *bGeo_h, DMVBGEO_ST *bGeo , TABLE_HEAD_ST *bPar_h, DMVBPAR_ST *bPar , TABLE_HEAD_ST *cGeo_h, DMVCGEO_ST *cGeo , TABLE_HEAD_ST *cPar_h, DMVCPAR_ST *cPar , TABLE_HEAD_ST *bRaw_h, DMVBRAW_ST *bRaw , TABLE_HEAD_ST *cRaw_h, DMVCRAW_ST *cRaw , TABLE_HEAD_ST *bSkev_h, DMVBSKEV_ST *bSkev , TABLE_HEAD_ST *VertexOut_h, DMVDVERTEXOUT_ST *VertexOut , TABLE_HEAD_ST *zPar_h, DMVDZCORPAR_ST *zPar , TABLE_HEAD_ST *tPar_h, DMVDTRIGPAR_ST *tPar , TABLE_HEAD_ST *Cntrl_h, DMVDTRIGCONTROL_ST *Cntrl , TABLE_HEAD_ST *Nclmp_h, DMVDNCLMP_ST *Nclmp , TABLE_HEAD_ST *Clmp_h, DMVDCLMP_ST *Clmp , TABLE_HEAD_ST *dNdEtaPar_h, DMVDDNDETAPAR_ST *dNdEtaPar , TABLE_HEAD_ST *dNdn_h, DMVDDNDETA_ST *dNdn , TABLE_HEAD_ST *Fic_h, DMVDFIC_ST *Fic , TABLE_HEAD_ST *dNdEtaOut_h, DMVDDNDETAOUT_ST *dNdEtaOut , TABLE_HEAD_ST *Io_h, DMVDIO_ST *Io ) { /*:>-------------------------------------------------------------------- **: ROUTINE: mMvdHst_ **: DESCRIPTION: Physics Analysis Module ANSI C template. **: This is an ANSI C Physics Analysis Module template **: automatically generated by stic from mMvdAna.idl. **: Please edit comments and code. **: **: AUTHOR : J.H.Park, S.S.Ryu, Y.K.Kim (YonSei Univ.) (Dec 15 97) **: Translated from the original Fortran version VER_HST.f, **: written by J.P.Sullivan **: **: ARGUMENTS: **: IN: **: Geo - contains MVD geometry information **: Geo_h - header Structure for Geo **: Head - event header, which contains things like the **: true vertex position, multiplicity, etc **: Head_h - header Structure for Head **: Par - a few misc parameters used in MVD calculations, **: e.g. signal per mip, length of MVD, etc.. **: Par_h - header Structure for Par **: bGeo - contains arrays with the dimension of the **: number of strips per row and number of **: wafers per row. **: bGeo_h - header Structure for bGeo **: bPar - contains some constants specifiying how many **: strips per row, phi segments, ... in barrel **: bPar_h - header Structure for bPar **: cGeo - contains arrays with the dimension of the **: number of rhi segments, ... **: cGeo_h - header Structure for cGeo **: cPar - contains some constants specifying how many **: phi segments, r segments, ... in pads **: cPar_h - header Structure for cPar **: bRaw - raw data structure for barrel **: bRaw_h - header Structure for bRaw **: cRaw - raw data structure for pads **: cRaw_h - header Structure for cRaw **: bSkev - for barrel, contains signal in keV for each **: channel hit **: bSkev_h - header Structure for bSkev **: VertexOut - vertex-finding output table **: VertexOut_h - header Structure for VertexOut **: zPar - one parameters (IEXPND) usd in correlation **: vertex finding algorithm **: zPar_h - header Structure for zPar **: tPar - Some "trigger" parameters, including the **: parameters which control which vertex-finding **: algorithm is used. **: tPar_h - header Structure for tPar **: Cntrl - some "trigger" parameters **: Cntrl_h - header Structure for Cntrl **: Nclmp - number of "clumps" per row and shell **: Nclmp_h - header Structure for Nclmp **: Clmp - list of clumps **: Clmp_h - header Structure for Clmp **: dNdEtaPar - parameters used in dN/deta calculations **: dNdEtaPar_h - header Structure for dNdEtaPar **: dNdn - dN/deta from deconvolution algorithm in pads **: dNdn_h - header Structure for dNdn **: Fic - multiplicity in N/S pads, inner/outer barrel **: Fic_h - header Structure for Fic **: dNdEtaOut - dN/deta output structure **: dNdEtaOut_h - header structure for dNdEtaOut **: Io - contains verbose parameter **: Io_h - header structure for Io **: INOUT: **: OUT: **: RETURNS: STAF Condition Value **: **: Revision History **: Name Date Comment **: C.F. Maguire Jan. 26, 1998 Initialize xntpl array; several **: of these elements are unused? **: J.H.Park Feb. 10, 1998 fix histograms for real vertex **: J.H.Park Feb. 23, 1998 fix "offset" variable **: add "vertex_fit" which is **: the calculated vertex point **: J.P.Sullivan Apr. 14, 1998 replace printf calls with MvdMess_ **: J.P.Sullivan Apr. 30, 1998 histograms which were previously **: for 1,2,3,4,5+ hits per pads are **: now for different ranges of mean **: occupancy in the pads. Also, the **: distance of the vertex from the **: pads was being calculated using **: the real vertex for these hists. **: This is "cheating", now the **: calculated vertex is used. **: J.P.Sullivan Jun. 16, 1998 Add dNdEtaOut to calling sequence **: and use it to make histograms **: J.P.Sullivan 10-Aug-98 Remove mMvdPseudoTrk, mMvdZcor, mMvdHst **: tables from calling sequence, add ** mMvdVertexOut. Move definitions of hists **: which were previously in mMvdSetHst to **: this routine. Added code to fill histograms **: of clump size vs. z and clump size vs. **: distance from vertex. They were booked but **: not filled before. Change file name from **: .c to .cc to use C++ compiler. Use a **: combination of phenix generic histogram **: interface and root to create and fill **: histograms. Replace mMvdMess with cout. **: J.P.Sullivan 23-Sep-98 Add dMvdIo to calling sequence and use **: it to control volume of output. **: J.P.Sullivan 30-Nov-98 Correct calculation of summev, correct **: name of one ntuple parameter **: S.S.Ryu 06-Jul-99 changes the variable "Cntl" to "Cntrl" to make **: this variable consistent throughout the MVD **: codes. **:>------------------------------------------------------------------*/ int i,j,k; int nstrip; float offset,celloccup,sumkev,xnptls; float innerclmpsum; float outerclmpsum; float vertex,vertex_fit; float xvertex_fit,yvertex_fit; float itrker; float xntpl[26]; float occup[4],mip[4]; float xadc; float cosring; float bimevt; short NPHUSE; float clsum; /* number of strips in a cell */ int ncl; /* number of clumps in a cell */ short EndOfCell; /* used as a switch */ float diff; float tantheta; float nhitfactor; float zcellpos; float phi; float summev; // 1D and 2D histograms use generic histogram factory: PhHistogramFactory *hf = PhHistogramFactory::instance(); static PhH1 *TrueMult; static PhH1 *TrueZvertex; static PhH1 *dZvertex; static PhH1 *NclumpVsZ1; static PhH1 *NclumpVsZ2; static PhH1 *Nclumps1; static PhH1 *Nclumps2; static PhH1 *stripADC; static PhH1 *padADC; static PhH1 *padADCocclt1; static PhH1 *padADCocc1to2; static PhH1 *padADCocc2to5; static PhH1 *padADCocc5to10; static PhH1 *padADCoccgt10; static PhH1 *MeVinSi; static PhH1 *ADCSumR1; static PhH1 *ADCSumR2; static PhH1 *ADCSumZp; static PhH1 *ADCSumZm; static PhH1 *OccR1; static PhH1 *OccR2; static PhH1 *OccZp; static PhH1 *OccZm; static PhH1 *bfm; // Ntuple and Profile histograms use root directly (since // the generic histogram factory does not have these types) static TFile *hfile; static TNtuple *MVDNtuple; static TProfile *ClumpVsZ1; static TProfile *ClumpVsZ2; static TProfile *OccVsZR1; static TProfile *OccVsZR2; static TProfile *MeVvsZvert; static TProfile *dNdetaAvg; static TProfile *dNdetaRow0; static TProfile *dNdetaRow1; static TProfile *dNdetaRow2; static TProfile *dNdetaRow3; static TProfile *dNdetaRow4; static TProfile *dNdetaRow5; static TProfile *dNdetaPadCount; static TProfile *dNdetaPadDeconv; static TProfile *dNdetaEv; static short first=0; int NCHDIM=bPar->NCHDIM; float ZOFF=Par->zoff; nstrip=Geo->nstrip; NPHUSE=bPar->NPHUSE; if ( Io->verbose < LOUD ) cout << "\nmMvdHst{ " << endl; if ( first == 0 ) { first = 1; /* The 2d declarations here are all really profile histograms originally. */ /* A 2d histogram is not really a substitute for the way the profile histograms */ /* were being used. I have not even setup the arguements to be correct for */ /* declaring a 2d histograms -- they are just left as they were for the */ /* profile histograms */ TrueMult = hf->CreateH1F("TrueMult","True total Mult.",100,0.,20000.); TrueZvertex = hf->CreateH1F("TrueZvertex","true z vertex", 50,-50.,50.); dZvertex = hf->CreateH1F("dZvertex","dZ vertex (found-true)", 200,-5.,5.); NclumpVsZ1 = hf->CreateH1F("NclumpVsZ1","Inner Shell : Nclmp vs. z", NCHDIM,-ZOFF,ZOFF); NclumpVsZ2 = hf->CreateH1F("NclumpVsZ2","Outer Shell : Nclmp vs. z", NCHDIM,-ZOFF,ZOFF); Nclumps1 = hf->CreateH1F("Nclumps1","Nclumps tot R1", 50, 0.,10000.); Nclumps2 = hf->CreateH1F("Nclumps2","Nclumps tot R2", 50, 0.,10000.); stripADC = hf->CreateH1F("stripADC","strip ADC value",300, 0., 300.); padADC = hf->CreateH1F("padADC1","pad ADC value", 300, 0., 300.); padADCocclt1 = hf->CreateH1F("padADCocclt1","pad ADC occ.lt.0.01", 300, 0., 300.); padADCocc1to2 = hf->CreateH1F("padADCocc1to2","pad ADC 0.01.gt.occ.lt.0.02", 300, 0., 300.); padADCocc2to5 = hf->CreateH1F("padADCocc2to5","pad ADC 0.02.gt.occ.lt.0.05", 300, 0., 300.); padADCocc5to10= hf->CreateH1F("padADCocc5to10","pad ADC 0.05.gt.occ.lt.0.10", 300, 0., 300.); padADCoccgt10 = hf->CreateH1F("padADCoccgt10","pad ADC occ.gt.0.1", 300, 0., 300.); MeVinSi = hf->CreateH1F("MeVinSi","MeV in Si", 100, 0., 2000.); ADCSumR1 = hf->CreateH1F("ADCSumR1","ADC sum inner barrel", 100,0.,20000.); ADCSumR2 = hf->CreateH1F("ADCSumR2","ADC sum outer barrel", 100,0.,20000.); ADCSumZp = hf->CreateH1F("ADCSumZp","ADC sum +Z pads",100,0.,20000.); ADCSumZm = hf->CreateH1F("ADCSumZm","ADC sum -Z pads",100,0.,20000.); OccR1 = hf->CreateH1F("OccR1","Avg occ. inner barrel",50,0.,1.); OccR2 = hf->CreateH1F("OccR2","Avg occ. outer barrel",50,0.,1.); OccZp = hf->CreateH1F("OccZp","Avg occ. +Z pads", 50,0.,1.); OccZm = hf->CreateH1F("OccZm","Avg occ. -Z pads", 50,0.,1.); bfm = hf->CreateH1F("bfm","b(fm) all events",10, 0., 12.); if ( Io->verbose < LOUD ) cout << "\t1D histos defined" << endl; OccVsZR1 = new TProfile("OccVsZR1","occ. R1",NCHDIM,-ZOFF,ZOFF); OccVsZR2 = new TProfile("OccVsZR2","occ. R2",NCHDIM,-ZOFF,ZOFF); ClumpVsZ1 = new TProfile("ClumpVsZ1", "Inner Shell:Clumpsize vs z-zvtx", 2*NCHDIM, -64.,64. ); ClumpVsZ2 = new TProfile("ClumpVsZ2", "Outer Shell : Clumpsize vs z-zvtx", 2*NCHDIM, -64.,64. ); MeVvsZvert = new TProfile("MeVvsZvert","MeV in Si vs Zvtx", 2*NCHDIM, -64.,64. ); dNdetaAvg = new TProfile("dNdetaAvg","dN/d[c] (event averaged)", N_ETA_BINS_IN_HIST,ETA_MIN_HIST,ETA_MAX_HIST); dNdetaRow0 = new TProfile("dNdetaRow0", "dN/d[c]d[f] (event averaged) row 0", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaRow1 = new TProfile("dNdetaRow1", "dN/d[c]d[f] (event averaged) row 1", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaRow2 = new TProfile("dNdetaRow2", "dN/d[c]d[f] (event averaged) row 2", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaRow3 = new TProfile("dNdetaRow3", "dN/d[c]d[f] (event averaged) row 3", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaRow4 = new TProfile("dNdetaRow4", "dN/d[c]d[f] (event averaged) row 4", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaRow5 = new TProfile("dNdetaRow5", "dN/d[c]d[f] (event averaged) row 5", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaPadCount = new TProfile("dNdetaPadCount", "dN/d[c] from pads,event avg,pad count", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaPadDeconv= new TProfile("dNdetaPadDeconv", "dN/d[c] from pads,event avg,deconv", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); dNdetaEv= new TProfile("dNdetaEv", "dN/d[c] (single event)", N_ETA_BINS_IN_HIST,ETA_MIN_HIST, ETA_MAX_HIST); if ( Io->verbose < LOUD ) cout << "\tprofile histos defined" << endl; // hfile = new TFile("mvd.root", "recreate", "STAF ROOT Histograms"); MVDNtuple = new TNtuple("MVDNtuple", "results", "Zvertex:MeV_SiR1:NPTLS:"// "strhit_1:strhit_2:bfm:ITRKER:Ztrkdif:occR1:occR2:"// "occpad1:occpad2:dsumR1:dsumR2:dsumpad1:dsumpad2:"// "NtrueR1:NtrueR2:Ntruepd1:Ntruepd2:paddcon1:"// "paddecon2:Xtrue:Ytrue:Xcalc:Ycalc"); if ( Io->verbose < LOUD ) cout << "\tntuple defined" << endl; } else dNdetaEv->Reset(0); /* this histograms is for a single event */ /* using header table */ bimevt=Head->b; /* impact parameter */ vertex=Head->vertex[2]; /* z of vertex */ xnptls=Head->multiplicity; /* true total multiplicity in Geant */ TrueMult->Fill(xnptls,1.); TrueZvertex->Fill(vertex,1.); bfm->Fill(bimevt,1.); if ( Cntrl->choice ==1 ) { vertex_fit=VertexOut->vertex[2]; /* vertex point from correlation method */ xvertex_fit=0.; /* correlation algorithm does not get x,y vertex */ yvertex_fit=0.; /* correlation algorithm does not get x,y vertex */ } else if ( Cntrl->choice ==2) { vertex_fit=VertexOut->vertex[2]; /* z vertex from pseudo-tracking method */ xvertex_fit=VertexOut->vertex[0]; /* x vertex from pseudo-tracking method */ yvertex_fit=VertexOut->vertex[1]; /* y vertex from pseudo-tracking method */ } else { /* use pseudotracking method when both are calculated */ vertex_fit=VertexOut->vertex[2]; /* z vertex from pseudo-tracking method */ xvertex_fit=VertexOut->vertex[0]; /* x vertex from pseudo-tracking method */ yvertex_fit=VertexOut->vertex[1]; /* y vertex from pseudo-tracking method */ } /* Histograms of the panel occupancy vs z position along vertex barrel. */ clsum=0; ncl=0; for (i=0; inok; ++i) { zcellpos=bGeo->zcell[Clmp[i].cell]; offset = zcellpos - Head->vertex[2]; /* use real vertex */ if ( Clmp[i].shell == 0 ) ClumpVsZ1->Fill(offset, (float)Clmp[i].clsize ); else ClumpVsZ2->Fill(offset, (float)Clmp[i].clsize ); /* the end of the list is a special case, it is always the last clump of the cell it is in */ EndOfCell = 0; if ( (i+1) == Clmp_h->nok ) EndOfCell = 1; else if ( (Clmp[i].shell != Clmp[i+1].shell) || (Clmp[i].row != Clmp[i+1].row ) || (Clmp[i].cell != Clmp[i+1].cell ) ) EndOfCell =1; clsum+=(float)Clmp[i].clsize; /* number of strips "on" */ ncl++; /* number of clumps */ if ( EndOfCell == 1 ) { celloccup=clsum/nstrip; if ( Clmp[i].shell == 0) { OccVsZR1->Fill(zcellpos,celloccup); NclumpVsZ1->Fill(zcellpos,(float)ncl); } if ( Clmp[i].shell ==1) { OccVsZR2->Fill(zcellpos,celloccup); NclumpVsZ2->Fill(zcellpos,(float)ncl); } clsum=0; ncl=0; } } /* in case of M.C simulation histogram difference between the calculated vertex position and true vertex position */ if ( VertexOut->ErrorCode ==1 && Cntrl->choice==1 && VertexOut->softvertex>2.0 && VertexOut->softvertex<2.99 ) { itrker=VertexOut->ErrorCode; offset= VertexOut->vertex[2]-Head->vertex[2]; /* cout << "\tZcor :itrker= " << itrker << " offset= " << offset << endl; */ dZvertex->Fill(offset,1.); } else if ( VertexOut->ErrorCode==1 && Cntrl->choice==2 && VertexOut->softvertex>1.0 && VertexOut->softvertex<1.99 ) { itrker=VertexOut->ErrorCode; offset= VertexOut->vertex[2]-Head->vertex[2]; /* cout << "\tPseudoTrk :itrker=" << itrker << " offset=" << offset << " soft=" << VertexOut->softvertex) << endl; */ dZvertex->Fill(offset,1.); } else { itrker=VertexOut->ErrorCode; offset= VertexOut->vertex[2]-Head->vertex[2]; /* cout << "\tZcor :itrker= " << itrker << " offset= " << offset << endl; */ dZvertex->Fill(offset,1.); } /* histogram of the total number of clumps found in an event in each of the two barrels */ innerclmpsum=0; outerclmpsum=0; for ( i=0;i< Nclmp_h->nok ;++i) { if ( Nclmp[i].shell == 0 ) innerclmpsum+=(float)Nclmp[i].num; if ( Nclmp[i].shell == 1) outerclmpsum+=(float)Nclmp[i].num; } Nclumps1->Fill(innerclmpsum,1.); Nclumps2->Fill(outerclmpsum,1.); /* convert to Mev average E loss and histogram */ sumkev=0; for ( i=0; i< bSkev_h->nok;++i) if ( bSkev[i].shell==0 ) sumkev+=bSkev[i].skev; summev = sumkev/1000.; MeVvsZvert->Fill(vertex,summev); MeVinSi->Fill(summev,1.); /* Histogram occupancy of barrels and endcaps */ OccR1->Fill(Cntrl->foccup[0],1.); OccR2->Fill(Cntrl->foccup[1],1.); OccZp->Fill(Cntrl->foccup[2],1.); OccZm->Fill(Cntrl->foccup[3],1.); /* get the sum of all digitized channels, this is what the trigger will be based on */ CalculateMips( bRaw_h,bRaw, cRaw_h,cRaw, Par, mip); ADCSumR1->Fill(mip[0],1.); ADCSumR2->Fill(mip[1],1.); ADCSumZp->Fill(mip[2],1.); ADCSumZm->Fill(mip[3],1.); /* ADC value histogram */ /* for barrel */ for (i=0;i < bRaw_h->nok;++i) if ( bRaw[i].adc > 0) stripADC->Fill((float)bRaw[i].adc,1.); /* for pad */ nhitfactor=Par->smax_mip/Par->full_scale; for (i=0; i < cRaw_h->nok; ++i) { diff=vertex_fit-cGeo->pad_z[cRaw[i].end]; /* using calculated vertex */ diff=diff >0 ? diff : -diff; if ( diff>dNdEtaPar->tooClose ) { tantheta=cGeo->rvals[cRaw[i].row]/diff; cosring=1./(float)sqrt((double)(1.0+tantheta*tantheta)); if (cRaw[i].adc >0 ) { xadc=cRaw[i].adc*cosring; padADC->Fill(xadc,1.); /* histogram ADC distributions for different occupancies in pads */ if ( Cntrl->foccup[1+cRaw[i].end] <= 0.01 ) padADCocclt1->Fill(xadc,1.); else if ( Cntrl->foccup[1+cRaw[i].end] <= .02 ) padADCocc1to2->Fill(xadc,1.); else if ( Cntrl->foccup[1+cRaw[i].end] <= .05 ) padADCocc2to5->Fill(xadc,1.); else if ( Cntrl->foccup[1+cRaw[i].end] <= .10 ) padADCocc5to10->Fill(xadc,1.); else padADCoccgt10->Fill(xadc,1.); } } } /********************************************/ /* make some various dN/deta histograms */ /* now fill them: */ if ( dNdEtaOut_h->nok > 0 ) { for (k=1;k<=dNdEtaOut_h->nok;++k) { if ( dNdEtaOut[k].softdndeta>1.0 && dNdEtaOut[k].softdndeta<2.0 ) { /* this section is for dN/deta from the barrel with all rows */ /* combined into a single eta bin */ dNdetaAvg->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); if ( Head->event<=MAX_SINGLE_EV_OUT ) dNdetaEv->Fill( dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); // cout << "\teta=" << dNdEtaOut[k].eta << " dN/deta=" // << dNdEtaOut[k].dndeta << endl; } else if ( dNdEtaOut[k].softdndeta>2.0 && dNdEtaOut[k].softdndeta<3.0 ) { /* this section is for dN/deta/dphi from individual rows in the barrel */ phi = dNdEtaOut[k].phi; if ( phi< 0.5236 && phi>-0.52366 ) dNdetaRow0->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); else if ( phi < 1.5708 ) dNdetaRow1->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); else if ( phi < 2.6180 ) dNdetaRow2->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); else if ( phi < 3.6652 ) dNdetaRow3->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); else if ( phi < 4.7124 ) dNdetaRow4->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); else if ( phi < 5.7596 ) dNdetaRow5->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); } else if ( dNdEtaOut[k].softdndeta>3.0 && dNdEtaOut[k].softdndeta<4.0 ) { /* this is the section for dN/deta from the average dE/dx calculation in the pad detectors */ dNdetaPadCount->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); } else if ( dNdEtaOut[k].softdndeta>4.0 && dNdEtaOut[k].softdndeta<5.0 ) { /* this is the section for dN/deta from the deconvolution method in the pad detectors */ dNdetaPadDeconv->Fill(dNdEtaOut[k].eta, dNdEtaOut[k].dndeta); } } } /********************************************/ /* fill the ntuple for this event */ xntpl[0]=Head->vertex[2]; /* true z vertex from PISA */ xntpl[1]=sumkev/1000.; xntpl[2]=xnptls; xntpl[3]=(float)innerclmpsum; xntpl[4]=(float)outerclmpsum; xntpl[5]=bimevt; xntpl[6]=itrker; xntpl[7]=offset; /* difference between calculated and true z vertex */ for(i=0;i<4;++i){ xntpl[8+i]=Cntrl->foccup[i]; xntpl[12+i]=mip[i]; } xntpl[16]=Fic->inner_multi; xntpl[17]=Fic->outer_multi; xntpl[18]=Fic->south_multi; xntpl[19]=Fic->north_multi; xntpl[20]=(float)dNdn->PadDeconv[0]; xntpl[21]=(float)dNdn->PadDeconv[1]; xntpl[22]=Head->vertex[0]; /* true x vertex from PISA */ xntpl[23]=Head->vertex[1]; /* true y vertex from PISA */ xntpl[24]=xvertex_fit; /* calc x vertex */ xntpl[25]=yvertex_fit; /* calc y vertex */ MVDNtuple->Fill(xntpl); if ( Io->verbose < LOUD ) cout << "}" << endl; return STAFCV_OK; } void CalculateMips( TABLE_HEAD_ST *bRaw_h, DMVBRAW_ST *bRaw , TABLE_HEAD_ST *cRaw_h, DMVCRAW_ST *cRaw , DMVDPAR_ST *Par , float *mip ) { int i; float factor; float inneradcsum,outeradcsum; float northpadsum,southpadsum; inneradcsum=outeradcsum=northpadsum=southpadsum=0; factor=Par->smax_mip/Par->full_scale; for (i=0; i< bRaw_h->nok;++i) { if (bRaw[i].shell == 0) inneradcsum+=bRaw[i].adc; if (bRaw[i].shell ==0) outeradcsum+=bRaw[i].adc; } for (i=0; i < cRaw_h->nok; ++i) { if (cRaw[i].end ==0) southpadsum+=cRaw[i].adc; if (cRaw[i].end == 1) northpadsum+=cRaw[i].adc; } mip[0]=factor*inneradcsum; mip[1]=factor*outeradcsum; mip[2]=factor*southpadsum; mip[3]=factor*northpadsum; }