Kevin's OFile Documentation

    //**************************************//
   //**************************************//
  //************P_OUT BRANCHES************//
 //**************************************//
//**************************************//

//***********************NOTES:************************************************************************\\
**                                                                                **
** NOT IMPLEMENTED means that the code declares the varible/array and then intializes the value(s)     **
** to 0, but then never makes an attempt to give these varibles any other value.                       **
**                                                                                                     **
** !!! means that the meaning is not 100% worked out, or was confusing to me in some way.           **
**                                                                                                     **
\\*****************************************************************************************************//

Int_t L0_clsum[4][3]; //[crate][L0 dsms]  100 * slotid(0~3) + channel(0~31)         !!!Sum of Cluster
p_out->Branch("L0_clsum",L0_clsum,"L0_clsum[4][3]/i");

Int_t L0_htadr[4][3]; //[crate][L0 dsms]                         !!!Something to do with the trigger           
p_out->Branch("L0_htadr",L0_htadr,"L0_htadr[4][3]/i");

Int_t L0_ht[4][3]; //[crate][L0 dsms]                            !!!
p_out->Branch("L0_ht",L0_ht,"L0_ht[4][3]/i");

UInt_t L1_TrigBits[3]; //Trigger info [L1 dsms]
p_out->Branch("L1_TrigBits",L1_TrigBits,"L1_TrigBits[3]/i");

UInt_t L2_TrigBits; //Trigger info [L2 dsms]
p_out->Branch("L2_TrigBits",&L2_TrigBits,"L2_TrigBits/i");

Int_t event; //event id
p_out->Branch("eventId",&event,"event/i");

Int_t Ntrack; //number of geant tracks                Note: Currently capped at 500 see line 489
p_out->Branch("Ntrack",&Ntrack,"Ntrack/I");

Int_t Nhit; //number of hits in the det.
p_out->Branch("Nhit",&Nhit,"Nhit/I");

Float_t vertexZ; //vertexZ of the event
p_out->Branch("vertexZ",&vertexZ,"vertexZ/F");

Int_t Ndiphot; //number of Pi0/Eta (number of 2 photon events)
p_out->Branch("Ndiphot",&Ndiphot,"Ndiphot/I");

//!!!line number = index number + 1!!!

Float_t Esum[4]; //sum of energy in each det.
p_out->Branch("Esum",Esum,"Esum[4]/F");

Float_t R1[4]; //energy share of the highest tower
p_out->Branch("R1",R1,"R1[4]/F");

Float_t R2[4]; //energy share of the second highest tower
p_out->Branch("R2",R2,"R2[4]/F");

Float_t R3[4]; //energy share of the third highest tower
p_out->Branch("R3",R3,"R3[4]/F");

Int_t Nphoton[4]; //number of photons in each det.
p_out->Branch("Nphoton",Nphoton,"Nphoton[4]/I");

Int_t Nmatchedphoton[4]; //number of matched (with Geant track) photons
p_out->Branch("Nmatchedphoton",Nmatchedphoton,"Nmatchedphoton[4]/I");

Int_t Ncluster[4]; //number of clusters in each det.
p_out->Branch("Ncluster",Ncluster,"Ncluster[4]/I");

Int_t NrealCluster[4]; //number of real clusters in each det.
p_out->Branch("NrealCluster",NrealCluster,"NrealCluster[4]/I");

Float_t rEsum[4]; //reconstructed sum of energy
p_out->Branch("rEsum",rEsum,"rEsum[4]/F");

Float_t rMgg[4]; //reconstructed mass
p_out->Branch("rMgg",rMgg,"rMgg[4]/F");

Float_t rZgg[4]; //reconstructed energy sharing
p_out->Branch("rZgg",rZgg,"rZgg[4]/F");

Float_t rDgg[4]; //reconstructed distance
p_out->Branch("rDgg",rDgg,"rDgg[4]/F");

Float_t rEtagg[4]; //reconstructed photon Eta
p_out->Branch("rEtagg",rEtagg,"rEtagg[4]/F");

Float_t rPhigg[4]; //reconstructed photon Phi
p_out->Branch("rPhigg",rPhigg,"rPhigg[4]/F");

Float_t rTheta[4]; //reconstructed photon Theta in x-y plane
p_out->Branch("rTheta",rTheta,"rTheta[4]/F");

Float_t rxgg[4]; //reconstructed x distance in local coordinate
p_out->Branch("rxgg",rxgg,"rxgg[4]/F");

Float_t rygg[4]; //reconstructed y distance in local coordinate
p_out->Branch("rygg",rygg,"rygg[4]/F");

Float_t rgxgg[4]; //reconstructed x distance in global coordinate
p_out->Branch("rgxgg",rgxgg,"rgxgg[4]/F");

Float_t rgygg[4]; //reconstructed y distance in global coordinate
p_out->Branch("rgygg",rgygg,"rgygg[4]/F");

Float_t rrgg[4]; //reconstructed photon rgg (gluon-gluon?)                !!!
p_out->Branch("rrgg",rrgg,"rrgg[4]/F");

Int_t ptrk[500]; //parent track line number
p_out->Branch("ptrk",ptrk,"ptrk[500]/i");

Int_t stat[500]; //track status
p_out->Branch("stat",stat,"stat[500]/i");

Int_t pdg[500]; //track pdg particle id (down quark - gluon?)                !!!
p_out->Branch("pdg",pdg,"pdg[500]/i");

Int_t gpid[500]; //track geant particle id
p_out->Branch("gpid",gpid,"gpid[500]/i");

Int_t mo[500][2]; //two mothers' line numbers
p_out->Branch("mo",mo,"mo[500][2]/i");

Int_t da[500][2]; //two daughters' line numbers
p_out->Branch("da",da,"da[500][2]/i");

Float_t e[500]; //track energy
p_out->Branch("e",e,"e[500]/F");

Float_t m[500]; //track mass
p_out->Branch("m",m,"m[500]/F");

Int_t NSTB[500]; //track NSTB
p_out->Branch("NSTB",NSTB,"NSTB[500]/i");

Float_t px[500]; //track px
p_out->Branch("Px",px,"px[500]/F");

Float_t py[500]; //track py
p_out->Branch("Py",py,"py[500]/F");

Float_t pz[500]; //track pz
p_out->Branch("Pz",pz,"pz[500]/F");

Float_t x[500]; //track local x
p_out->Branch("x",x,"x[500]/F");

Float_t y[500]; //track local y
p_out->Branch("y",y,"y[500]/F");

Float_t gx[500]; //track global x
p_out->Branch("gx",gx,"gx[500]/F");

Float_t gy[500]; //track global y
p_out->Branch("gy",gy,"gy[500]/F");

Float_t Eta[500]; //track Eta
p_out->Branch("Eta",Eta,"Eta[500]/F");

Float_t Phi[500]; //track Phi
p_out->Branch("Phi",Phi,"Phi[500]/F");

Float_t r[500]; //track distance in eta/phi plane
p_out->Branch("r",r,"r[500]/F");

 
Float_t Eraw[1732]; //energy for all the towers in the four det.
p_out->Branch("Eraw",Eraw,"Eraw[1732]/F");

Int_t Di_trk[100]; //Geant Pi0/Eta index number
p_out->Branch("Di_trk",Di_trk,"Di_trk[100]/I");

Int_t Di_pdg[100]; //pdg particle id (Pi0=111, Eta=211)                    !!!
p_out->Branch("Di_pdg",Di_pdg,"Di_pdg[100]/I");

Int_t Di_d1[100];  //daughter 1 index number
p_out->Branch("Di_d1",Di_d1,"Di_d1[100]/I");

Int_t Di_d2[100];  //daughter 2 index number
p_out->Branch("Di_d2",Di_d2,"Di_d2[100]/I");

Float_t Di_e[100]; //energy
p_out->Branch("Di_e",Di_e,"Di_e[100]/F");

Float_t Di_x[100]; //local x position
p_out->Branch("Di_x",Di_x,"Di_x[100]/F");

Float_t Di_y[100]; //local y position
p_out->Branch("Di_y",Di_y,"Di_y[100]/F");

Float_t Di_gx[100]; //global x position
p_out->Branch("Di_gx",Di_gx,"Di_gx[100]/F");

Float_t Di_gy[100]; //global y position
p_out->Branch("Di_gy",Di_gy,"Di_gy[100]/F");

Float_t Di_Eta[100]; //Eta
p_out->Branch("Di_Eta",Di_Eta,"Di_Eta[100]/F");

Float_t Di_Phi[100]; //Phi
p_out->Branch("Di_Phi",Di_Phi,"Di_Phi[100]/F");

Float_t Di_r[100]; //r
p_out->Branch("Di_r",Di_r,"Di_r[100]/F");

Float_t Zgg[100]; //energy sharing
p_out->Branch("Zgg",Zgg,"Zgg[100]/F");

Float_t Dgg[100]; //daughter distance
p_out->Branch("Dgg",Dgg,"Dgg[100]/F");

Float_t Theta[100]; //Theta in x-y plane
p_out->Branch("Theta",Theta,"Theta[100]/F");

Float_t re[100][4]; //reconstructed energy
p_out->Branch("rE",re,"re[100][4]/F");

Float_t rpx[100][4]; //reconstructed px
p_out->Branch("rPx",rpx,"rpx[100][4]/F");

Float_t rpy[100][4]; //reconstructed py
p_out->Branch("rPy",rpy,"rpy[100][4]/F");

Float_t rpz[100][4]; //reconstructed pz
p_out->Branch("rPz",rpz,"rpz[100][4]/F");

Float_t rx[100][4]; //reconstructed x position
p_out->Branch("rx",rx,"rx[100][4]/F");

Float_t ry[100][4]; //reconstructed y position
p_out->Branch("ry",ry,"ry[100][4]/F");

Float_t rgx[100][4]; //reconstructed global x position
p_out->Branch("rgx",rgx,"rgx[100][4]/F");

Float_t rgy[100][4]; //reconstructed global y position
p_out->Branch("rgy",rgy,"rgy[100][4]/F");

Float_t rEta[100][4]; //reconstructed Eta
p_out->Branch("rEta",rEta,"rEta[100][4]/F");

Float_t rPhi[100][4]; //reconstructed Phi
p_out->Branch("rPhi",rPhi,"rPhi[100][4]/F");

Float_t rr[100][4]; //reconstructed distance to (3.65,0) in eta and phi
p_out->Branch("rr",rr,"rr[100][4]/F");

Int_t matchedTrack[100][4]; //matched geant track index number, <0 if not matched
p_out->Branch("matchedTrack",matchedTrack,"matchedTrack[100][4]/I");

Int_t Cl_catag[100][4]; //cluster categary
p_out->Branch("Cl_catag",Cl_catag,"Cl_catag[100][4]/I");

Int_t Cl_Ntower[100][4]; //number of towers
p_out->Branch("Cl_Ntower",Cl_Ntower,"Cl_Ntower[100][4]/I");

Int_t Cl_Nphoton[100][4]; //number of photons
p_out->Branch("Cl_Nphoton",Cl_Nphoton,"Cl_Nphoton[100][4]/I");

Int_t Cl_Ntrk[100][4]; //number of tracks associated with
p_out->Branch("Cl_Ntrk",Cl_Ntrk,"Cl_Ntrk[100][4]/I");

Int_t Cl_Ntrk_EM[100][4]; //number of EM tracks associated with
p_out->Branch("Cl_Ntrk_EM",Cl_Ntrk_EM,"Cl_Ntrk_EM[100][4]/I");

Float_t Cl_Esum[100][4]; //energy sum
p_out->Branch("Cl_Esum",Cl_Esum,"Cl_Esum[100][4]/F");

Float_t Cl_x0[100][4]; //local x position
p_out->Branch("Cl_x0",Cl_x0,"Cl_x0[100][4]/F");

Float_t Cl_y0[100][4]; //local y position
p_out->Branch("Cl_y0",Cl_y0,"Cl_y0[100][4]/F");

Float_t Cl_thetaAxis[100][4]; //cluster theta
p_out->Branch("Cl_thetaAxis",Cl_thetaAxis,"Cl_thetaAxis[100][4]/F");

Float_t Cl_sigmaX[100][4]; //cluster sigma x
p_out->Branch("Cl_sigmaX",Cl_sigmaX,"Cl_sigmaX[100][4]/F");

Float_t Cl_sigmaY[100][4]; //cluster sigma y
p_out->Branch("Cl_sigmaY",Cl_sigmaY,"Cl_sigmaY[100][4]/F");

Float_t Cl_sigmaMin[100][4]; //cluster sigma min
p_out->Branch("Cl_sigmaMin",Cl_sigmaMin,"Cl_sigmaMin[100][4]/F");

Float_t Cl_sigmaMax[100][4]; //cluster sigma max
p_out->Branch("Cl_sigmaMax",Cl_sigmaMax,"Cl_sigmaMax[100][4]/F");

Double_t Cl_chiSq[100][4]; //cluster fitting chi^2
p_out->Branch("Cl_chiSq",Cl_chiSq,"Cl_chiSq[100][4]/D");

Int_t Cl_trk[100][10][4]; //index number of associated tracks
p_out->Branch("Cl_trk",Cl_trk,"Cl_trk[100][10][4]/I");

Int_t Cl_trk_EM[100][10][4]; //index number of associated EM tracks
p_out->Branch("Cl_trk_EM",Cl_trk_EM,"Cl_trk_EM[100][10][4]/I");

Int_t Cl_diphot[100][10][4]; //index number of associated Pi0/Eta
p_out->Branch("Cl_diphot",Cl_diphot,"Cl_diphot[100][10][4]/I");

Float_t Cl_R[100][4][4]; //energy share of the first 4 towers
p_out->Branch("Cl_R",Cl_R,"Cl_R[100][4][4]/F");

Float_t Cl_P[100][4][4]; //some tricks by Len!                        !!! These tricks seem to check a hit cluster hc for the number of towers and depending on the tower number
p_out->Branch("Cl_P",Cl_P,"Cl_P[100][4][4]/F");                        (from tower 1 to tower 3) the values of Cl_P[j][tower][iNSTB] are set using various methods
                                            (For more see lines 1054 to line 1082 in simrecon.C)

Int_t Rnum; //Run Number
p_out->Branch("br_Rnum",&(Rnum),"Rnum/I");

Int_t Bunchid7bit;// Always set to 0?                            !!!NOT IMPLEMENTED
p_out->Branch("br_Bunchid7bit",&(Bunchid7bit),"Bunchid7bit/I");

Int_t tpes[320];                                    These take on either a value of 5-8 (for detectors 1-4) or a value of 305-308(for detectors 1-4)
p_out->Branch("br_types",(tpes),"tpes[nwrds]/I");                    depending on if nz=rec.NPh returns values. (see lines 856-868)

Int_t spin; //spin                                    !!!NOT IMPLEMENTED
p_out->Branch("spin",&(spin),"spin/I");

Int_t nphotons; //number of photons accross all 4 detectors
p_out->Branch("nphotons",&(nphotons),"nphotons/I");

Float_t pxyzt[320];// Stores px, py, pz, E                 (Ex. px[0] = pxyzt[0], py[0]=pxyzt[1]....px[1]=pxyzt[4])
p_out->Branch("br_pxyzt",(pxyzt),"pxyzt[nwrds]/F");

Int_t nwrds;//This seems to be a incrementing varible that is used as the index of several of the other arrays in this tree
p_out->Branch("br_nwrds",&(nwrds),"nwrds/I");

Char_t BBcSums[5];// Always set to 0?                                    !!!NOT IMPLEMENTED
p_out->Branch("br_BBcSums",BBcSums,"BBcSums[5]/b");

Float_t BBcVertex[7];// Always set to 0?                                !!!NOT IMPLEMENTED
p_out->Branch("br_BBcVertex",BBcVertex,"BBcVertex[7]/F");

Int_t EventN;// Always set to 0?                                    !!!NOT IMPLEMENTED
p_out->Branch("br_EventN",&(EventN),"EventN/I");

Int_t ievt;// number of events from the simulation
p_out->Branch("br_ievt",&(ievt),"ievt/I");

unsigned int SavedHits[1000];//The data for saved hit [nSavedHit]
p_out->Branch("br_SavedHits",(SavedHits),"SavedHits[nSavedHits]/I");

Int_t nSavedHits;//The index that goes into the SavedHits array
p_out->Branch("br_nSavedHits",&(nSavedHits),"nSavedHits/I");

UInt_t   mNumQTdata;//This is used in the encodeQT and then it is directly sent to decodeQT        !!!
p_out->Branch("br_mNumQTdata",&(mNumQTdata),"mNumQTdata/I");

UInt_t   mQTdata[1600];//This is encoded and then decoded along with mNumQT                !!!
p_out->Branch("br_mQTdata",(mQTdata),"mQTdata[1600]/I");

==============================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==============================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==============================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==============================================================================================================================

    //**************************************//
   //**************************************//
  //************1D HISTOGRAMS*************//
 //**************************************//
//**************************************//

//***********************NOTES:************************************************************************\\
**                                                                                **
** NOT IMPLEMENTED means that it is declared in the code, but the code never attempts to fill the TH1  **
** in any way. A majority of the histograms that are saved in the current SimRecon code are in fact    **
** NOT IMPLEMENTED. Therefore it is hard to say how most of these histograms were going to be used.    **
**                                                                                **
** ??? means speculation based on the name of the histogram. None of these histograms were implemented **
**                                                                                **
\\*****************************************************************************************************//

TH1F     hN_tot;1        hN_tot            ??? Total Number? NOT IMPLEMENTED IN CODE

TH1F     hSum_NL;1       hSum_NL        ??? Sum of NL (part of detector?)? NOT IMPLEMENTED IN CODE

TH1F     hN_NL;1 hN_NL                ??? Number of hits in NL? NOT IMPLEMENTED IN CODE

TH1F     hSum_SL;1       hSum_SL        ??? Sum of NL (part of detector?)? NOT IMPLEMENTED IN CODE   

TH1F     hN_SL;1 hN_SL                ??? Number of hits in SL? NOT IMPLEMENTED IN CODE

TH1F     hSum_NS;1       hSum_NS        ??? Sum of NS (part of detector?)? NOT IMPLEMENTED IN CODE

TH1F     hN_NS;1 hN_NS                ??? Number of hits in NS? NOT IMPLEMENTED IN CODE               

TH1F     hSum_SS;1       hSum_SS        ??? Sum of SS (part of detector?)? NOT IMPLEMENTED IN CODE

TH1F     hN_SS;1 hN_SS                ??? Number of hits in SS? NOT IMPLEMENTED IN CODE

TH1F     hSumADC;1       hSumADC        ??? Sum of the ADC hits? NOT IMPLEMENTED IN CODE

TH1F     hMult;1 hMult                ??? No idea on this one. NOT IMPLEMENTED IN CODE

TH1F     hTbit;1 hTbit                ???Something to do with the trigger bits. NOT IMPLEMENTED IN CODE

==============================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==============================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==============================================================================================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==============================================================================================================================

    //**************************************//
   //**************************************//
  //************2D HISTOGRAMS*************//
 //**************************************//
//**************************************//

//***********************NOTES:************************************************************************\\
**                                                                                **
** NOT IMPLEMENTED means that it is declared in the code, but the code never attempts to fill the TH2  **
** in any way. A majority of the histograms that are saved in the current SimRecon code are in fact    **
** NOT IMPLEMENTED. Therefore it is hard to say how most of these histograms were going to be used.    **
**                                                                                **
\\*****************************************************************************************************//

TH2F     hSml0;1 hSml0                ???    Hits: Detector Location, Small cells?

TH2F     hSml1;1 hSml1                ???    Hits: Detector Location, Small cells? NOT IMPLEMENTED IN CODE

TH2F     hSml2;1 hSml2                ???    Hits: Detector Location, Small cells? NOT IMPLEMENTED IN CODE

TH2F     hSml2;1 hSml2                ???    Repeat for some reason

TH2F     hSmln;1 hSmln                ???    Hits: Detector Location, Small cells? NOT IMPLEMENTED IN CODE

TH2F     hLrg0;1 hLrg0                ???    Hits: Detector Location, Large cells?   

TH2F     hLrg1;1 hLrg1                ???    Hits: Detector Location, Large cells? NOT IMPLEMENTED IN CODE

TH2F     hLrg2;1 hLrg2                ???    Hits: Detector Location, Large cells? NOT IMPLEMENTED IN CODE

TH2F     hLrgn;1 hLrgn                ???    Hits: Detector Location, Large cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Sml0;1       hL1Sml0        ???    Hits: ???, small cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Sml1;1       hL1Sml            ???    Hits: ???, small cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Sml2;1       hL1Sml2        ???    Hits: ???, small cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Smln;1       hL1Smln        ???    Hits: ???, small cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Lrg0;1       hL1Lrg0        ???    Hits: ???, large cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Lrg1;1       hL1Lrg1        ???    Hits: ???, large cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Lrg2;1       hL1Lrg2        ???    Hits: ???, large cells? NOT IMPLEMENTED IN CODE

TH2F     hL1Lrgn;1       hL1Lrgn        ???    Hits: ???, large cells? NOT IMPLEMENTED IN CODE

TH2F     enedis;1        Energy            ???    Energy distribution, shows how energy was distributed throughout the detector