#include "honlinemonhist.h" #include "honlinehistarray.h" #include "honlinetrendhist.h" #include "hcategory.h" #include "fwdetdef.h" #include "hfrpcraw.h" #include "hfrpccal.h" #include "hfrpchit.h" #include "hfrpccluster.h" map < TString , HOnlineMonHistAddon* > frpcMap; //---------------------------------------------------------------------------------------------- // Initialize histograms //---------------------------------------------------------------------------------------------- struct frpcP { HOnlineMonHistAddon* h_FRpc_strip_cnts = 0; HOnlineMonHistAddon* h_FRpc_strip_hits = 0; HOnlineMonHistAddon* h_FRpc_strip_tof = 0; HOnlineMonHistAddon* h_FRpc_mult = 0; HOnlineMonHistAddon* h_FRpc_mult_all = 0; HOnlineMonHistAddon* h_FRpc_cal_v = 0; HOnlineMonHistAddon* h_FRpcColCellCharge = 0; HOnlineMonHistAddon* h_FRpc_Position_XY = 0; }; frpcP* pFRpc; //---------------------------------------------------------------------------------------------- // Create histograms //---------------------------------------------------------------------------------------------- Bool_t createHistFRpc(TList& histpool) { mapHolder::setMap(frpcMap); // make frpcMap currentMap //---------------------------------------------------------------------------------------------- // Defining histogram parameters //---------------------------------------------------------------------------------------------- const Char_t* hists[] = { // 2D histograms tables (straw_module:straw_layer) "FORMAT#array TYPE#2F NAME#h_FRpc_strip_cnts TITLE#Strip_FRpc ACTIVE#1 RESET#1 REFRESH#5000 BIN#16:0.0:15.0:2:0.0:2.0 SIZE#2:2 AXIS#Strip:Column:no DIR#no OPT#colz STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#2F NAME#h_FRpc_strip_tof TITLE#Tof_Strip ACTIVE#1 RESET#1 REFRESH#5000 BIN#32:0.0:32.0:500:0.0:499.0 SIZE#2:2 AXIS#Tof::no DIR#no OPT#colz STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#1F NAME#h_FRpc_mult TITLE#Multiplicity ACTIVE#1 RESET#1 REFRESH#5000 BIN#10:0.0:10.0:0:0:0 SIZE#2:2 AXIS#Multiplicity:Counts:no DIR#no OPT#no STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#1F NAME#h_FRpc_mult_all TITLE#Multiplicity_all ACTIVE#1 RESET#1 REFRESH#5000 BIN#10:0.0:10.0:0:0:0 SIZE#1:1 AXIS#Multiplicity:Counts:no DIR#no OPT#no STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#2F NAME#h_FRpc_cal_v TITLE#cal_v ACTIVE#1 RESET#1 REFRESH#5000 BIN#32:0.0:32.0:100:-500.0:500.0 SIZE#2:2 AXIS#Strip:V:no DIR#no OPT#colz STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#1F NAME#h_FRpc_strip_hits TITLE#strip_hits ACTIVE#1 RESET#1 REFRESH#5000 BIN#32:0.0:32.0:0:1:0 SIZE#2:2 AXIS#strip:Counts:no DIR#no OPT#no STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#2F NAME#h_FRpcColCellCharge TITLE#Charge_distribution ACTIVE#1 RESET#1 REFRESH#50000 BIN#64:0.0:64.0:100:0.0:100.0 SIZE#2:2 AXIS#Strip:Column:no DIR#no OPT#colz STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", "FORMAT#array TYPE#2F NAME#h_FRpc_Position_XY TITLE#Position_XY ACTIVE#1 RESET#1 REFRESH#100000 BIN#1600:-800.0:800.0:1600:-800.0:800.0 SIZE#1:1 AXIS#X:Y:no DIR#no OPT#colz STATS#0 LOG#0:0:0 GRID#1:1 LINE#1:0 FILL#0:0 MARKER#0:0:0 RANGE#-99:-99", }; // Create histograms and add them to the pool mapHolder::createHists(sizeof(hists)/sizeof(Char_t*),hists,histpool); pFRpc = new frpcP(); pFRpc->h_FRpc_strip_cnts = get("h_FRpc_strip_cnts"); pFRpc->h_FRpc_strip_tof = get("h_FRpc_strip_tof"); pFRpc->h_FRpc_mult = get("h_FRpc_mult"); pFRpc->h_FRpc_mult_all = get("h_FRpc_mult_all"); pFRpc->h_FRpc_cal_v = get("h_FRpc_cal_v"); pFRpc->h_FRpc_strip_hits=get("h_FRpc_strip_hits"); pFRpc->h_FRpcColCellCharge = get("h_FRpcColCellCharge"); pFRpc->h_FRpc_Position_XY = get("h_FRpc_Position_XY"); //---------------------------------------------------------------------------------------------- // Setting colors for histogram arrays //---------------------------------------------------------------------------------------------- // Colors Int_t colorsSector[4] = {2, 4, 6, 8}; HOnlineMonHistAddon* addon = 0; if( (addon = pFRpc->h_FRpc_mult )) { for(Int_t i = 0; i < 4; i ++) { addon->getP(i/2,i%2)->SetLineColor(colorsSector[i]); } } if( (addon = pFRpc->h_FRpc_strip_hits )) { for(Int_t i = 0; i < 4; i ++) { addon->getP(i/2,i%2)->SetLineColor(colorsSector[i]); } } //---------------------------------------------------------------------------------------------- // Accessing geometry container //---------------------------------------------------------------------------------------------- HRuntimeDb *rtdb = HRuntimeDb::instance();//myHades -> getRuntimeDb(); rtdb->initContainers(1); rtdb->print(); return kTRUE; } //---------------------------------------------------------------------------------------------- // Main part of the program //---------------------------------------------------------------------------------------------- Bool_t fillHistFRpc(Int_t evtCt) { mapHolder::setMap(frpcMap); // make frpcMap currentMap //---------------------------------------------------------------------------------------------- // Categories to access //---------------------------------------------------------------------------------------------- HCategory* fFRpcRaw = gHades->getCurrentEvent()->getCategory(catFRpcRaw); HCategory* fFrpcCal = gHades->getCurrentEvent()->getCategory(catFRpcCal); HCategory* fFrpcHitCat=gHades->getCurrentEvent()->getCategory(catFRpcHit); //---------------------------------------------------------------------------------------------- // fFRpcRaw category - accessing, loop over entries and filling histograms //---------------------------------------------------------------------------------------------- if(fFrpcHitCat) { Int_t multiplicity_ALL = fFrpcHitCat->getEntries(); // Get number of entries (number of signals registered by straws) in one event for(Int_t i = 0; i < multiplicity_ALL; i ++) // Loop over entries inside each event { //sec HFRpcHit* hit = (HFRpcHit*)fFrpcHitCat->getObject(i); float_t x=hit->getX(); float_t y = hit->getY(); pFRpc->h_FRpc_Position_XY->getP(0,0)->Fill(x,y); } } if(fFrpcCal) { Int_t multiplicity_ALL_Call = fFrpcCal->getEntries(); for(Int_t i = 0; i < multiplicity_ALL_Call; i ++) { HFRpcCal * frpccal = (HFRpcCal*)fFrpcCal->getObject(i); if(frpccal) { Char_t sec_c, strip_c; frpccal->getAddress(sec_c, strip_c); const Float_t y=frpccal->getV() ; pFRpc->h_FRpc_cal_v->getP(sec_c/2,sec_c%2)->Fill(strip_c,y); Float_t var1,var2,chargeleft,chargeright; const Float_t l=0.1,r=1.1; frpccal->getHit(var1,var2,chargeleft,chargeright); pFRpc->h_FRpcColCellCharge->getP(sec_c/2,sec_c%2)->Fill((float)2*strip_c+l,chargeleft); pFRpc->h_FRpcColCellCharge->getP(sec_c/2,sec_c%2)->Fill((float)2*strip_c+r,chargeright); } } } if(fFRpcRaw) { Int_t multiplicity_ALL = fFRpcRaw->getEntries(); // Get number of entries (number of signals registered by straws) in one event pFRpc->h_FRpc_mult_all->getP(0,0)->Fill(multiplicity_ALL); Int_t mult_module[4] = { 0 }; for(Int_t i = 0; i < multiplicity_ALL; i ++) // Loop over entries inside each event { HFRpcRaw * frpcraw = (HFRpcRaw*)fFRpcRaw->getObject(i); // Get fFRpcRaw object if(frpcraw) // Check if "frpcetstraw" object was accessed properly { // Initializing extracted variables Char_t sec, col, strip; Float_t toftime0,tofwidth0,toftime1,tofwidth1; // time - time of first registration of signal (crossing threshold), width - Time over Threshold frpcraw->getAddress(sec, col, strip); ++mult_module[(UInt_t)sec]; pFRpc->h_FRpc_strip_cnts->getP(sec/2,sec%2)->Fill(strip, col); frpcraw->getTimeAndWidthF(0,toftime0,tofwidth0); frpcraw->getTimeAndWidthN(0,toftime1,tofwidth1); pFRpc->h_FRpc_strip_tof->getP(sec/2,sec%2)->Fill(2*strip+col, (toftime0+toftime1)/2); pFRpc->h_FRpc_strip_hits->getP(sec/2,sec%2)->Fill(2*strip+col); } } for (Int_t i = 0; i < 4; ++i) pFRpc->h_FRpc_mult->getP(i/2,i%2)->Fill(mult_module[i]); } //---------------------------------------------------------------------------------------------- // Reset if needed //---------------------------------------------------------------------------------------------- mapHolder::resetHists(evtCt); return kTRUE; }