#include "StructDef.h" #include "FileListDef.h" // Overloaded functions used to get a user friendly date/time input as string void plot_Current_Date(TString sInputName = "LogHv_Full_CernFeb15.root", TString sStartDate = "2015-02-24 09:56:00", TString sStopDate = "2015-03-05 07:53:00", Int_t iNbSecPerBin = 1, Int_t iSpillDistSec= kiSpillDistSec, Int_t iFirstDet = 0, Int_t iSecondDet = 1, Int_t iRefDet = 30 ) { // Use ROOT TDatime class for its nice string to date function TDatime dateStart(sStartDate); TDatime dateStop( sStopDate); cout< Start on 01/01/1970 as we use // are the UNIX time frame! gStyle->SetTimeOffset(0); // Do real call to function plot_Current_Date_B( sInputName, timeStart, timeStop, iNbSecPerBin, iSpillDistSec, iFirstDet, iSecondDet, iRefDet ); } Bool_t plot_Current_Date_B( TString sInputName = "LogHv_Full_CernFeb15.root", TTimeStamp tStartTime = 1424768160, // Start of rate data taking TTimeStamp tStopTime = 1425538380, // End of rate data taking Int_t iNbSecPerBin = 1, Int_t iSpillDistSec= kiSpillDistSec, Int_t iFirstDet = 0, Int_t iSecondDet = 2, Int_t iRefDet = 30 ) { // For now this macro works only for "RPC"-like detectors if( ( !( 0 <= iFirstDet && iFirstDet < kiNbRpc) && !( 0 <= iFirstDet-kiPmtOffset && iFirstDet-kiPmtOffset < kiNbPmt) ) || ( !( 0 <= iSecondDet && iSecondDet < kiNbRpc) && !( 0 <= iSecondDet-kiPmtOffset && iSecondDet-kiPmtOffset < kiNbPmt) ) ) { cout<<" One of the Detector indices is out of bound"<IsOpen() ) { cout<< Form("Input file %s cannot be opened.", sInputFilenameHv.Data())<Get("CaenHV"); if(!tInputTreeHv) { cout<<"No Hv tree inside the input file for CAEN HV."<GetEntries(); TBranch* tBranchEventRpc[kiNbRpc]; Rpc_HV tRpcHvEvt[kiNbRpc]; for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) { tBranchEventRpc[iRpcIndex] = NULL; tBranchEventRpc[iRpcIndex] = tInputTreeHv->GetBranch( sChNameRpc[iRpcIndex] ); if(!tBranchEventRpc[iRpcIndex]) { cout<<"No branch "<SetAddress(&(tRpcHvEvt[iRpcIndex].iTimeSec)); } // for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) TBranch* tBranchEventPmt[kiNbPmt]; Pmt_HV tPmtHvEvt[kiNbPmt]; for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) { tBranchEventPmt[iPmtIndex] = NULL; tBranchEventPmt[iPmtIndex] = tInputTreeHv->GetBranch( sChNamePmt[iPmtIndex] ); if(!tBranchEventPmt[iPmtIndex]) { cout<<"No branch "<SetAddress(&(tPmtHvEvt[iPmtIndex].iTimeSec)); } // for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) /* Rpc_HV tDetHvEvtA; Rpc_HV tDetHvEvtB; Pmt_HV tDetHvEvtDiam; TBranch* tBranchEventDetA = NULL; tBranchEventDetA = tInputTreeHv->GetBranch( sNameFirstDet ); if(!tBranchEventDetA) { cout<<"No branch "<SetAddress(&(tDetHvEvtA.iTimeSec)); TBranch* tBranchEventDetB = NULL; tBranchEventDetB = tInputTreeHv->GetBranch( sNameSecondDet ); if(!tBranchEventDetB) { cout<<"No branch "<SetAddress(&(tDetHvEvtB.iTimeSec)); TBranch* tBranchEventDetDiam = NULL; // tBranchEventDetDiam = tInputTreeHv->GetBranch( "calo" ); // tBranchEventDetDiam = tInputTreeHv->GetBranch( "BFL" ); // tBranchEventDetDiam = tInputTreeHv->GetBranch( "PMT5" ); tBranchEventDetDiam = tInputTreeHv->GetBranch( "Dia_PMT" ); if(!tBranchEventDetDiam) { cout<<"No branch Dia_PMT in input tree."<SetAddress(&(tDetHvEvtDiam.iTimeSec)); */ // Switch back current directory to gROOT so that new object are created in memory, not in file gROOT->cd(); // TTofCalibScaler* tEventScal(0); cout<SetLineColor(kBlue); hCurrentEvoNegA->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNegA->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoPosA = new TProfile( "hCurrentEvoPosA", Form("Current evolution for the Positive HV of %s; Time [s]; Current [uA]", sNameFirstDet.Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoPosA->SetLineColor(kRed); hCurrentEvoPosA->GetXaxis()->SetTimeDisplay(1); hCurrentEvoPosA->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoNegB = new TProfile( "hCurrentEvoNegB", Form("Current evolution for the Negative HV of %s; Time [s]; Current [uA]", sNameSecondDet.Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoNegB->SetLineColor(kBlue); hCurrentEvoNegB->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNegB->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoPosB = new TProfile( "hCurrentEvoPosB", Form("Current evolution for the Positive HV of %s; Time [s]; Current [uA]", sNameSecondDet.Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoPosB->SetLineColor(kRed); hCurrentEvoPosB->GetXaxis()->SetTimeDisplay(1); hCurrentEvoPosB->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); // Full time interval histograms for diamonds TProfile * hCurrentEvoDiam = new TProfile( "hCurrentEvoDiam", Form("Current evolution for the HV of %s; Time [s]; Current [uA]", sChNamePmt[iRefDet].Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoDiam->SetLineColor(kBlue); hCurrentEvoDiam->GetXaxis()->SetTimeDisplay(1); hCurrentEvoDiam->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hVoltageEvoDiam = new TProfile( "hVoltageEvoDiam", Form("Voltage evolution for the HV of %s; Time [s]; Voltage [V]", sChNamePmt[iRefDet].Data()), iNbBins, dStartTime, dStopTime ); hVoltageEvoDiam->SetLineColor(kBlue); hVoltageEvoDiam->GetXaxis()->SetTimeDisplay(1); hVoltageEvoDiam->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); // In spill histograms Int_t iNbBinsSpill = (Int_t)(tStopTime.GetSec() - tStartTime.GetSec()) /iSpillDistSec; TProfile * hCurrentEvoSpillNegA = new TProfile( "hCurrentEvoSpillNegA", Form("Current evolution for the Negative HV of %s in spill; Time [s]; Current [uA]", sNameFirstDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoSpillNegA->SetLineColor(kBlue); hCurrentEvoSpillNegA->GetXaxis()->SetTimeDisplay(1); hCurrentEvoSpillNegA->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoSpillPosA = new TProfile( "hCurrentEvoSpillPosA", Form("Current evolution for the Positive HV of %s in spill; Time [s]; Current [uA]", sNameFirstDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoSpillPosA->SetLineColor(kRed); hCurrentEvoSpillPosA->GetXaxis()->SetTimeDisplay(1); hCurrentEvoSpillPosA->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoSpillNegB = new TProfile( "hCurrentEvoSpillNegB", Form("Current evolution for the Negative HV of %s in spill; Time [s]; Current [uA]", sNameSecondDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoSpillNegB->SetLineColor(kBlue); hCurrentEvoSpillNegB->GetXaxis()->SetTimeDisplay(1); hCurrentEvoSpillNegB->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoSpillPosB = new TProfile( "hCurrentEvoSpillPosB", Form("Current evolution for the Positive HV of %s in spill; Time [s]; Current [uA]", sNameSecondDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoSpillPosB->SetLineColor(kRed); hCurrentEvoSpillPosB->GetXaxis()->SetTimeDisplay(1); hCurrentEvoSpillPosB->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); // Out of spill histograms TProfile * hCurrentEvoNoSpillNegA = new TProfile( "hCurrentEvoNoSpillNegA", Form("Current evolution for the Negative HV of %s off spill; Time [s]; Current [uA]", sNameFirstDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoNoSpillNegA->SetLineColor(kBlue); hCurrentEvoNoSpillNegA->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNoSpillNegA->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoNoSpillPosA = new TProfile( "hCurrentEvoNoSpillPosA", Form("Current evolution for the Positive HV of %s off spill; Time [s]; Current [uA]", sNameFirstDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoNoSpillPosA->SetLineColor(kRed); hCurrentEvoNoSpillPosA->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNoSpillPosA->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoNoSpillNegB = new TProfile( "hCurrentEvoNoSpillNegB", Form("Current evolution for the Negative HV of %s off spill; Time [s]; Current [uA]", sNameSecondDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoNoSpillNegB->SetLineColor(kBlue); hCurrentEvoNoSpillNegB->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNoSpillNegB->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoNoSpillPosB = new TProfile( "hCurrentEvoNoSpillPosB", Form("Current evolution for the Positive HV of %s off spill; Time [s]; Current [uA]", sNameSecondDet.Data()), iNbBinsSpill, dStartTime, dStopTime ); hCurrentEvoNoSpillPosB->SetLineColor(kRed); hCurrentEvoNoSpillPosB->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNoSpillPosB->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); TProfile * hCurrentEvoNegRpc[kiNbRpc]; TProfile * hCurrentEvoPosRpc[kiNbRpc]; for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) { hCurrentEvoNegRpc[iRpcIndex] = new TProfile( Form("hCurrentEvoNegRpc_%s", sChNameRpc[iRpcIndex].Data() ), Form("Current evolution for the Positive HV of %s; Time [s]; Current [uA]", sChNameRpc[iRpcIndex].Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoNegRpc[iRpcIndex]->SetLineColor(kBlue); hCurrentEvoNegRpc[iRpcIndex]->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNegRpc[iRpcIndex]->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); hCurrentEvoPosRpc[iRpcIndex] = new TProfile( Form("hCurrentEvoPosRpc_%s", sChNameRpc[iRpcIndex].Data() ), Form("Current evolution for the Positive HV of %s; Time [s]; Current [uA]", sChNameRpc[iRpcIndex].Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoNegRpc[iRpcIndex]->SetLineColor(kRed); hCurrentEvoNegRpc[iRpcIndex]->GetXaxis()->SetTimeDisplay(1); hCurrentEvoNegRpc[iRpcIndex]->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); } // for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) TProfile * hCurrentEvoPmt[kiNbPmt]; TProfile * hVoltageEvoPmt[kiNbPmt]; for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) { hCurrentEvoPmt[iPmtIndex] = new TProfile( Form("hCurrentEvoPmt_%s", sChNamePmt[iPmtIndex].Data() ), Form("Current evolution for the HV of %s; Time [s]; Current [uA]", sChNamePmt[iPmtIndex].Data()), iNbBins, dStartTime, dStopTime ); hCurrentEvoPmt[iPmtIndex]->SetLineColor(kBlue); hCurrentEvoPmt[iPmtIndex]->GetXaxis()->SetTimeDisplay(1); hCurrentEvoPmt[iPmtIndex]->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); hVoltageEvoPmt[iPmtIndex] = new TProfile( Form("hVoltageEvoPmt_%s", sChNamePmt[iPmtIndex].Data() ), Form("Voltage evolution for the HV of %s; Time [s]; Voltage [V]", sChNamePmt[iPmtIndex].Data()), iNbBins, dStartTime, dStopTime ); hVoltageEvoPmt[iPmtIndex]->SetLineColor(kRed); hVoltageEvoPmt[iPmtIndex]->GetXaxis()->SetTimeDisplay(1); hVoltageEvoPmt[iPmtIndex]->GetXaxis()->SetTimeFormat("#splitline{%d\/%m}{%H:%M}"); } // for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) Int_t iNbHvPoint = 0; for( UInt_t uHvPoint = 0; uHvPoint < uNTreeEntriesHv; uHvPoint ++) { tInputTreeHv->GetEntry(uHvPoint); // First get time using the first detector // TIP: need to explicitly add a 0 for the nanoseconds to be sure the right // ctor is used! TTimeStamp tEventTime( (time_t)(tPmtHvEvt[iRefDet].iTimeSec), 0 ); // Jump events before chosen start time if( tEventTime < tStartTime ) continue; // Stop looping when chosen stop time is reached if( tStopTime < tEventTime ) break; // Plot current vs time if( kTRUE == bFirstIsRpc ) // RPC { hCurrentEvoNegA->Fill( tEventTime.GetSec(), tRpcHvEvt[iFirstDet].dCurrentNeg ); hCurrentEvoPosA->Fill( tEventTime.GetSec(), tRpcHvEvt[iFirstDet].dCurrentPos ); } // if( kTRUE == bFirstIsRpc ) else // PMT { hCurrentEvoNegA->Fill( tEventTime.GetSec(), tPmtHvEvt[iFirstDet].dCurrent ); } if( kTRUE == bSecondIsRpc ) // RPC { hCurrentEvoNegB->Fill( tEventTime.GetSec(), tRpcHvEvt[iSecondDet].dCurrentNeg ); hCurrentEvoPosB->Fill( tEventTime.GetSec(), tRpcHvEvt[iSecondDet].dCurrentPos ); } // if( kTRUE == bSecondIsRpc ) else // PMT { hCurrentEvoNegB->Fill( tEventTime.GetSec(), tPmtHvEvt[iSecondDet].dCurrent ); } hCurrentEvoDiam->Fill( tEventTime.GetSec(), tPmtHvEvt[iRefDet].dCurrent ); hVoltageEvoDiam->Fill( tEventTime.GetSec(), tPmtHvEvt[iRefDet].dVoltage ); // Plot current vs time if( kdSpillDiamThr <= tPmtHvEvt[iRefDet].dCurrent ) { if( kTRUE == bFirstIsRpc ) // RPC { hCurrentEvoSpillNegA->Fill( tEventTime.GetSec(), tRpcHvEvt[iFirstDet].dCurrentNeg ); hCurrentEvoSpillPosA->Fill( tEventTime.GetSec(), tRpcHvEvt[iFirstDet].dCurrentPos ); } // if( kTRUE == bFirstIsRpc ) else // PMT { hCurrentEvoSpillNegA->Fill( tEventTime.GetSec(), tPmtHvEvt[iFirstDet].dCurrent ); } if( kTRUE == bSecondIsRpc ) // RPC { hCurrentEvoSpillNegB->Fill( tEventTime.GetSec(), tRpcHvEvt[iSecondDet].dCurrentNeg ); hCurrentEvoSpillPosB->Fill( tEventTime.GetSec(), tRpcHvEvt[iSecondDet].dCurrentPos ); } // if( kTRUE == bSecondIsRpc ) else // PMT { hCurrentEvoSpillNegB->Fill( tEventTime.GetSec(), tPmtHvEvt[iSecondDet].dCurrent ); } } // if( kdSpillDiamThr <= dMeanFluxDiamA ) else if( tPmtHvEvt[iRefDet].dCurrent < kdNoSpillDiamThr ) { if( kTRUE == bFirstIsRpc ) // RPC { hCurrentEvoNoSpillNegA->Fill( tEventTime.GetSec(), tRpcHvEvt[iFirstDet].dCurrentNeg ); hCurrentEvoNoSpillPosA->Fill( tEventTime.GetSec(), tRpcHvEvt[iFirstDet].dCurrentPos ); } // if( kTRUE == bFirstIsRpc ) else // PMT { hCurrentEvoNoSpillNegA->Fill( tEventTime.GetSec(), tPmtHvEvt[iFirstDet].dCurrent ); } if( kTRUE == bSecondIsRpc ) // RPC { hCurrentEvoNoSpillNegB->Fill( tEventTime.GetSec(), tRpcHvEvt[iSecondDet].dCurrentNeg ); hCurrentEvoNoSpillPosB->Fill( tEventTime.GetSec(), tRpcHvEvt[iSecondDet].dCurrentPos ); } // if( kTRUE == bSecondIsRpc ) else // PMT { hCurrentEvoNoSpillPosB->Fill( tEventTime.GetSec(), tPmtHvEvt[iSecondDet].dCurrent ); } } // else if( dMeanFluxDiamA < kdNoSpillDiamThr ) for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) { hCurrentEvoNegRpc[iRpcIndex]->Fill( tEventTime.GetSec(), tRpcHvEvt[iRpcIndex].dCurrentNeg ); hCurrentEvoPosRpc[iRpcIndex]->Fill( tEventTime.GetSec(), tRpcHvEvt[iRpcIndex].dCurrentPos ); } // for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) { hCurrentEvoPmt[iPmtIndex]->Fill( tEventTime.GetSec(), tPmtHvEvt[iPmtIndex].dCurrent ); hVoltageEvoPmt[iPmtIndex]->Fill( tEventTime.GetSec(), tPmtHvEvt[iPmtIndex].dVoltage ); } // for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) /* cout<<"MBS Time HV point #"<GetEntries()<<" " <GetEntries()<GetEntries()<<" " <GetEntries()<SetFillColor(0); tCanvasA->SetGridx(0); tCanvasA->SetGridy(0); tCanvasA->SetTopMargin(0); tCanvasA->SetRightMargin(0); tCanvasA->SetBottomMargin(0); tCanvasA->SetLeftMargin(0); tCanvasA->Divide(2); tCanvasA->cd(1); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoPosA->Draw("hSAME"); hCurrentEvoNegA->Draw("hSAME"); */ THStack* hStackCurEvoA = new THStack( "hStackCurEvoA", Form( "Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sNameFirstDet.Data()) ); hStackCurEvoA->Add( hCurrentEvoPosA ); hStackCurEvoA->Add( hCurrentEvoNegA ); hStackCurEvoA->Draw("nostack,h"); tCanvasA->cd(2); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoPosB->Draw("hSAME"); hCurrentEvoNegB->Draw("hSAME"); */ THStack* hStackCurEvoB = new THStack( "hStackCurEvoB", Form( "Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sNameSecondDet.Data()) ); hStackCurEvoB->Add( hCurrentEvoPosB ); hStackCurEvoB->Add( hCurrentEvoNegB ); hStackCurEvoB->Draw("nostack,h"); TCanvas* tCanvasDiam = new TCanvas("tCanvasDiam","Currents evolution Diamond",0,0,1000, 500); tCanvasDiam->SetFillColor(0); tCanvasDiam->SetGridx(0); tCanvasDiam->SetGridy(0); tCanvasDiam->SetTopMargin(0); tCanvasDiam->SetRightMargin(0); tCanvasDiam->SetBottomMargin(0); tCanvasDiam->SetLeftMargin(0); tCanvasDiam->Divide(2); tCanvasDiam->cd(1); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); hCurrentEvoDiam->Draw("hSAME"); tCanvasDiam->cd(2); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); hVoltageEvoDiam->Draw("hSAME"); TCanvas* tCanvasB = new TCanvas("tCanvasB","Currents evolution in spill",0,0,1000, 500); tCanvasB->SetFillColor(0); tCanvasB->SetGridx(0); tCanvasB->SetGridy(0); tCanvasB->SetTopMargin(0); tCanvasB->SetRightMargin(0); tCanvasB->SetBottomMargin(0); tCanvasB->SetLeftMargin(0); tCanvasB->Divide(2); tCanvasB->cd(1); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoSpillPosA->Draw("hSAME"); hCurrentEvoSpillNegA->Draw("hSAME"); */ THStack* hStackCurEvoSpillA = new THStack( "hStackCurEvoSpillA", Form( "In-spill Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sNameFirstDet.Data()) ); hStackCurEvoSpillA->Add( hCurrentEvoSpillPosA ); hStackCurEvoSpillA->Add( hCurrentEvoSpillNegA ); hStackCurEvoSpillA->Draw("nostack,h"); tCanvasB->cd(2); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoSpillPosB->Draw("hSAME"); hCurrentEvoSpillNegB->Draw("hSAME"); */ THStack* hStackCurEvoSpillB = new THStack( "hStackCurEvoSpillB", Form( "In-spill Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sNameSecondDet.Data()) ); hStackCurEvoSpillB->Add( hCurrentEvoSpillPosB ); hStackCurEvoSpillB->Add( hCurrentEvoSpillNegB ); hStackCurEvoSpillB->Draw("nostack,h"); TCanvas* tCanvasC = new TCanvas("tCanvasC","Currents evolution out of spill",0,0,1000, 500); tCanvasC->SetFillColor(0); tCanvasC->SetGridx(0); tCanvasC->SetGridy(0); tCanvasC->SetTopMargin(0); tCanvasC->SetRightMargin(0); tCanvasC->SetBottomMargin(0); tCanvasC->SetLeftMargin(0); tCanvasC->Divide(2); tCanvasC->cd(1); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoNoSpillPosA->Draw("hSAME"); hCurrentEvoNoSpillNegA->Draw("hSAME"); */ THStack* hStackCurEvoNoSpillA = new THStack( "hStackCurEvoNoSpillA", Form( "Out-spill Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sNameFirstDet.Data()) ); hStackCurEvoNoSpillA->Add( hCurrentEvoNoSpillPosA ); hStackCurEvoNoSpillA->Add( hCurrentEvoNoSpillNegA ); hStackCurEvoNoSpillA->Draw("nostack,h"); tCanvasC->cd(2); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoNoSpillPosB->Draw("hSAME"); hCurrentEvoNoSpillNegB->Draw("hSAME"); */ THStack* hStackCurEvoNoSpillB = new THStack( "hStackCurEvoNoSpillB", Form( "Out-spill Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sNameSecondDet.Data()) ); hStackCurEvoNoSpillB->Add( hCurrentEvoNoSpillPosB ); hStackCurEvoNoSpillB->Add( hCurrentEvoNoSpillNegB ); hStackCurEvoNoSpillB->Draw("nostack,h"); TCanvas* tCanvasRpc = new TCanvas("tCanvasRpc","Currents evolution for all RPCs",0,0,1200, 900); tCanvasRpc->SetFillColor(0); tCanvasRpc->SetGridx(0); tCanvasRpc->SetGridy(0); tCanvasRpc->SetTopMargin(0); tCanvasRpc->SetRightMargin(0); tCanvasRpc->SetBottomMargin(0); tCanvasRpc->SetLeftMargin(0); tCanvasRpc->Divide(4, 3); THStack* hStackCurEvoRpc[kiNbRpc]; for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) { tCanvasRpc->cd(1 + iRpcIndex); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hCurrentEvoNegRpc[iRpcIndex]->Draw("hSAME"); hCurrentEvoPosRpc[iRpcIndex]->Draw("hSAME"); */ hStackCurEvoRpc[iRpcIndex] = new THStack( Form("hStackCurEvoRpc_%s", sChNameRpc[iRpcIndex].Data() ), Form( "Current evolution for the Positive and Negative HV of %s; Time [s]; Current [uA]", sChNameRpc[iRpcIndex].Data()) ); hStackCurEvoRpc[iRpcIndex]->Add( hCurrentEvoNegRpc[iRpcIndex] ); hStackCurEvoRpc[iRpcIndex]->Add( hCurrentEvoPosRpc[iRpcIndex] ); hStackCurEvoRpc[iRpcIndex]->Draw("nostack,h"); } // for( Int_t iRpcIndex = 0; iRpcIndex < kiNbRpc; iRpcIndex++) TCanvas* tCanvasPmt = new TCanvas("tCanvasPmt","Currents evolution for all PMTs",0,0,1200, 900); tCanvasPmt->SetFillColor(0); tCanvasPmt->SetGridx(0); tCanvasPmt->SetGridy(0); tCanvasPmt->SetTopMargin(0); tCanvasPmt->SetRightMargin(0); tCanvasPmt->SetBottomMargin(0); tCanvasPmt->SetLeftMargin(0); tCanvasPmt->Divide(4, 3); THStack* hStackCurEvoPmt[kiNbPmt]; for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) { tCanvasPmt->cd(1 + iPmtIndex); gPad->SetTopMargin(0.15); gPad->SetRightMargin(0.15); gPad->SetBottomMargin(0.15); gPad->SetLeftMargin(0.15); /* hVoltageEvoPmt[iPmtIndex]->Draw("hSAME"); hCurrentEvoPmt[iPmtIndex]->Draw("hSAME"); */ hStackCurEvoPmt[iPmtIndex] = new THStack( Form("hStackCurEvoRpc_%s", sChNamePmt[iPmtIndex].Data() ), Form( "Voltage and Current evolution for the HV of %s; Time [s]; Current [uA]", sChNamePmt[iPmtIndex].Data()) ); hStackCurEvoPmt[iPmtIndex]->Add( hVoltageEvoPmt[iPmtIndex] ); hStackCurEvoPmt[iPmtIndex]->Add( hCurrentEvoPmt[iPmtIndex] ); hStackCurEvoPmt[iPmtIndex]->Draw("nostack,h"); } // for( Int_t iPmtIndex = 0; iPmtIndex < kiNbPmt; iPmtIndex++) fInputFileHv->Close(); return kTRUE; }