//*-- AUTHOR : Vladimir Pechenov //*-- Modified : 05/06/2002 by V.Pechenov //*-- Modified : 30/05/2001 by V.Pechenov //*-- Modified : 7/11/2000 by V.Pechenov //_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////// // HMdcClusSim // // Data object for Mdc cluster. // // Int_t getNTracks() - num. of tracks which have hits in cluster // (5 tracks maximum) // Int_t getTrack(Int_t indx) - return track number. // indx= 0, ..., (getNTracks()-1). // List of tracks is sorted: first track (indx=0) // have most number of hits, ... // // Short_t getNTimesInTrack(Int_t indx) - num. of hits // in cluster from track getTrack(indx) // // Int_t getNLayersInTrack(Int_t indx, Int_t m=-1) num. layers // with hits from track getTrack(indx): // m=0 - in first module of segment, // m=1 - in second module of segment, // m!=0 && m!=1 - in segment // //////////////////////////////////////////////////////////////// using namespace std; #include "hmdcclussim.h" #include "hades.h" #include "hmdctrackddef.h" #include "hmdccal1sim.h" #include "hevent.h" #include "hmatrixcategory.h" #include #include ClassImp(HMdcClusSim) void HMdcClusSim::calcTrList(void) { HCategory *fCalCat=gHades->getCurrentEvent()->getCategory(catMdcCal1); if( !fCalCat ) { nTracks=0; return; } HLocation loc; loc.set(4,sec,0,0,0); Int_t nTr=0; Int_t lsTr[100]; Int_t ind[100]; UChar_t nLay[100][2]; UChar_t nHt[100]; for(Int_t lay=0; lay<12; lay++) { Int_t modInd=lay/6; Int_t cell=-1; Short_t add=1<<(lay%6); loc[1]=modInd+seg*2; loc[2]=lay%6; while((cell=next(lay,cell)) >= 0) { UChar_t nTms=getTime(lay,cell); loc[3]=cell; HMdcCal1Sim *sim=(HMdcCal1Sim*)fCalCat->getObject(loc); if(!sim) { Error("getNTracks()", " Can't get object HMdcCal1Sim for address [%i][%i][%i][ %i ]", loc[0]+1,loc[1]+1,loc[2]+1,loc[3]+1); continue; } Int_t track=0; for(Int_t t=0; t<2; t++) { if(t==0 && (nTms&1)) track=sim->getNTrack1(); else if(t==1 && (nTms&2)) track=sim->getNTrack2(); else continue; Int_t indx=nTr; for(Int_t n=0; n1) { Bool_t sort=kTRUE; while(sort) { sort=kFALSE; for(Int_t n=0; n5) ? 5:nTr; for(Int_t n=0; ngetCurrentEvent()->getCategory(catMdcCal1); if( !fCalCat ) { nTracksM[0]=nTracksM[1]=0; return; } Int_t mod=m&1; HLocation loc; loc.set(4,sec,0,0,0); Int_t nTr=0; Int_t lsTr[100]; Int_t ind[100]; UChar_t nHt[100]; for(Int_t lay=mod*6; lay<(mod+1)*6; lay++) { Int_t modInd=lay/6; Int_t cell=-1; loc[1]=modInd+seg*2; loc[2]=lay%6; while((cell=list.next(lay,cell)) >= 0) { UChar_t nTms=list.getTime(lay,cell); loc[3]=cell; HMdcCal1Sim *sim=(HMdcCal1Sim*)fCalCat->getObject(loc); if(!sim) { Error("getNTracks()", " Can't get object HMdcCal1Sim for address [%i][%i][%i][ %i ]", loc[0]+1,loc[1]+1,loc[2]+1,loc[3]+1); continue; } Int_t track=0; for(Int_t t=0; t<2; t++) { if(t==0 && (nTms&1)) track=sim->getNTrack1(); else if(t==1 && (nTms&2)) track=sim->getNTrack2(); else continue; Int_t indx=nTr; for(Int_t n=0; n1) { Bool_t sort=kTRUE; while(sort) { sort=kFALSE; for(Int_t n=0; n5) ? 5:nTr; for(Int_t n=0; n=nTracks) return 0; if(m==0 || m==1) return HMdcBArray::getNSet(nLayers[indx][m]); else return HMdcBArray::getNSet(nLayers[indx][0])+ HMdcBArray::getNSet(nLayers[indx][1]); } void HMdcClusSim::printCont(Bool_t fl) const { printf(" GEANT: %i tracks in cluster:",nTracks); for(Int_t n=0; ngetCurrentEvent()->getCategory(catMdcCal1); // if(!fCalCat) { if(fl) HMdcClus::printCont(fl); // return; // } // HLocation loc; // for(Int_t lay=0; lay<12; lay++) { // Int_t mod=seg*2+lay/6; // Int_t nCells=getNCells(lay); // if(!nCells) continue; // printf(" M.%i L.%i %i cells:",mod+1,lay%6+1,nCells); // Int_t cell=-1; // while((cell=next(lay,cell)) >= 0) { // Int_t nTms=getTime(lay,cell); // printf(" %i(%i)[",cell+1,HMdcBArray::getNSet(nTms)); // loc.set(4,sec,mod,lay%6,cell); // HMdcCal1Sim *sim=(HMdcCal1Sim*)fCalCat->getObject(loc); // if(nTms&1) printf("%i",sim->getNTrack1()); // if(nTms&2) printf(",%i",sim->getNTrack2()); // printf("]"); // } // printf("\n"); // } }