/////////////////////////////////////////////////////////////////////////////// // fill WALL branches of GEANT ROOT tree // // last modified on 05/12/2008 by I. Koenig /////////////////////////////////////////////////////////////////////////////// #include "fillwall.h" #include "cfortran.h" #include "hgeantwall.h" #include "hgeantmaxtrk.h" #include "hades.h" #include "hlocation.h" #include "hlinearcategory.h" #include "hrecevent.h" #include "hpartialevent.h" #include "hgeantkine.h" struct WL_DEF { // structure mapped to WLTUPLE Fortran COMMON block Int_t ntrk; Int_t wltrk[MAXTRKWALL]; Int_t wlmod[MAXTRKWALL]; Int_t wlcell[MAXTRKWALL]; Float_t wle[MAXTRKWALL]; Float_t wlx[MAXTRKWALL]; Float_t wly[MAXTRKWALL]; Float_t wltof[MAXTRKWALL]; Float_t wlmom[MAXTRKWALL]; Float_t wllen[MAXTRKWALL]; }; #define WLTUPLE COMMON_BLOCK(WLTUPLE,wltuple) COMMON_BLOCK_DEF(WL_DEF,WLTUPLE); void fillwall(void) { HLocation loc; HRecEvent* pHGeantEvent = (HRecEvent*)(gHades->getCurrentEvent()); // get pointer to event HPartialEvent* pSimul = pHGeantEvent->getPartialEvent(catSimul); HCategory* pWallCat = pSimul->getCategory(catWallGeantRaw); // get category pWallCat->Clear(); // clear category if 1st sector HCategory* pKin = pSimul->getCategory(catGeantKine); // get KINE cat Int_t index; Int_t module,cell; for(int trk=0; trkgetNewSlot(loc); // get slot if(pWall==NULL) { printf("\n*** FILLWALL: HGeantWall location not found ! ***\n"); printf("trk=%d\n",trk); return; } index = trk; pWall = new(pWall) HGeantWall; // Wall track data Int_t track = WLTUPLE.wltrk[trk]; pWall->setTrack(track); pWall->setHit(WLTUPLE.wle[trk],WLTUPLE.wlx[trk],WLTUPLE.wly[trk], WLTUPLE.wltof[trk],WLTUPLE.wlmom[trk],WLTUPLE.wllen[trk]); pWall->setAddress((Char_t) module,(Int_t) cell); if(pKin != NULL && track > 0) { // add hit to linked list of track ((HGeantKine*)pKin->getObject(track-1))->setWallHitIndex(index); pWall->sortVariable = WLTUPLE.wltof[trk]; } } if(pKin != NULL) { // loop all over all tracks ... Int_t nTracks = pKin->getEntries(); for(Int_t i=0;igetObject(i))->sortWallHits(); // ... and sort hits } } } // wrapping of the c++ routine as Fortran-subroutine using cfortran.h // of Cern-library FCALLSCSUB0(fillwall,FILLWALL,fillwall)