MDQ_IslandLength
[Low Level Data Quality Checks]

Plots information related to length of TPIs in each bank per MIDAS event. More...

Functions

INT MDQ_IslandLength_init (void)
INT MDQ_IslandLength (EVENT_HEADER *, void *)
INT MDQ_IslandLength_eor (INT)

Variables

HNDLE hDB
TGlobalDatagData
 Object to hold data used and produced by modules throughout alcapana stage of analysis.
TSetupDatagSetup
 Hardware information about digitizers and detectors to be used during alcapana stage of analysis.
map< std::string, TH1F * > DQ_IslandLength_histograms_map
 Map of bank name to histogram of TPI lengths per event.
map< std::string, TH1F * > DQ_IslandLength_histograms_normalised_map
 Same as DQ_IslandLength_histograms_map but normalized to number of muons according to TDC.
TH1F * hDQ_TDCCheck_muSc
 Coount of number of muSc hits in a run in the TDC.
ANA_MODULE MDQ_IslandLength_module

Detailed Description

Plots information related to length of TPIs in each bank per MIDAS event.

Author:
Nam Tran

Creates several histograms.


Function Documentation

INT MDQ_IslandLength ( EVENT_HEADER *  pheader,
void *  pevent 
)

This method fills the histograms

Definition at line 155 of file MDQ_IslandLength.cpp.

References DQ_IslandLength_histograms_map, DQ_IslandLength_histograms_normalised_map, TGlobalData::fPulseIslandToChannelMap, and TSetupData::GetDetectorName().

00156 {
00157         // Get the event number
00158         int midas_event_number = pheader->serial_number;
00159 
00160         // Some typedefs
00161         typedef map<string, vector<TPulseIsland*> > TStringPulseIslandMap;
00162         typedef pair<string, vector<TPulseIsland*> > TStringPulseIslandPair;
00163         typedef map<string, vector<TPulseIsland*> >::iterator map_iterator;
00164 
00165         // Fetch a reference to the gData structure that stores a map
00166         // of (bank_name, vector<TPulseIsland*>) pairs
00167         TStringPulseIslandMap& pulse_islands_map =
00168                 gData->fPulseIslandToChannelMap;
00169 
00170         // Loop over the map and get each bankname, vector pair
00171         for (map_iterator mapIter = pulse_islands_map.begin(); 
00172                         mapIter != pulse_islands_map.end(); ++mapIter) 
00173         {
00174           std::string bankname = mapIter->first;
00175           std::string detname = gSetup->GetDetectorName(bankname);
00176           std::vector<TPulseIsland*> thePulses = mapIter->second;
00177           
00178           // Get the histograms before looping through the pulses
00179           TH1F* hDQ_IslandLength = DQ_IslandLength_histograms_map[bankname];
00180           TH1F* hDQ_IslandLength_Norm = DQ_IslandLength_histograms_normalised_map[bankname];
00181           
00182           // Loop over the TPulseIslands and plot the histogram
00183           for (std::vector<TPulseIsland*>::iterator pulseIter = thePulses.begin();
00184                                 pulseIter != thePulses.end(); ++pulseIter) {
00185 
00186             // Make sure the histograms exist and then fill them
00187             if (DQ_IslandLength_histograms_map.find(bankname) != DQ_IslandLength_histograms_map.end()) 
00188               { 
00189                 const std::vector<int>& theSamples = (*pulseIter)->GetSamples();
00190                 hDQ_IslandLength->Fill(theSamples.size());
00191                 hDQ_IslandLength_Norm->Fill(theSamples.size());
00192             }
00193           }
00194         }
00195         return SUCCESS;
00196 }

INT MDQ_IslandLength_eor ( INT  run_number  ) 

This method does any last minute things to the histograms at the end of the run

Definition at line 125 of file MDQ_IslandLength.cpp.

References DQ_IslandLength_histograms_normalised_map, TGlobalData::fPulseIslandToChannelMap, TSetupData::GetDetectorName(), and hDQ_TDCCheck_muSc.

00125                                          {
00126 
00127   // Some typedefs
00128   typedef map<string, vector<TPulseIsland*> > TStringPulseIslandMap;
00129   typedef pair<string, vector<TPulseIsland*> > TStringPulseIslandPair;
00130   typedef map<string, vector<TPulseIsland*> >::iterator map_iterator;
00131   
00132   // Fetch a reference to the gData structure that stores a map
00133   // of (bank_name, vector<TPulseIsland*>) pairs
00134   TStringPulseIslandMap& pulse_islands_map =
00135     gData->fPulseIslandToChannelMap;
00136 
00137   // Loop over the map and get each bankname, vector pair
00138   for (map_iterator mapIter = pulse_islands_map.begin(); mapIter != pulse_islands_map.end(); ++mapIter) {
00139 
00140     std::string bankname = mapIter->first;
00141     std::string detname = gSetup->GetDetectorName(bankname);
00142       
00143     // Make sure the histograms exist and then fill them
00144     if (DQ_IslandLength_histograms_normalised_map.find(bankname) != DQ_IslandLength_histograms_normalised_map.end()) {
00145       DQ_IslandLength_histograms_normalised_map[bankname]->Scale(1./hDQ_TDCCheck_muSc->GetEntries());
00146     }
00147   }
00148 
00149   return SUCCESS;
00150 }

INT MDQ_IslandLength_init (  ) 

This method initializes histograms.

Definition at line 81 of file MDQ_IslandLength.cpp.

References DQ_IslandLength_histograms_map, DQ_IslandLength_histograms_normalised_map, TSetupData::fBankToDetectorMap, and TSetupData::GetDetectorName().

00082 {
00083   // See if the DataQuality_LowLevel/ directory already exists
00084   std::string dir_name("DataQuality_LowLevel/");
00085   if (!gDirectory->Cd(dir_name.c_str())) {
00086     gDirectory->mkdir(dir_name.c_str());
00087     gDirectory->Cd(dir_name.c_str());
00088   }
00089 
00090 
00091   // Create a histogram for each detector
00092   std::map<std::string, std::string> bank_to_detector_map = gSetup->fBankToDetectorMap;
00093   for(std::map<std::string, std::string>::iterator mapIter = bank_to_detector_map.begin(); 
00094       mapIter != bank_to_detector_map.end(); mapIter++) { 
00095 
00096     std::string bankname = mapIter->first;
00097     std::string detname = gSetup->GetDetectorName(bankname);
00098 
00099     // hDQ_IslandLength_[DetName]_[BankName]
00100     std::string histname = "hDQ_IslandLength_" + detname + "_" + bankname;
00101     std::string histtitle = "Length of each TPulseIsland in " + detname;
00102     TH1F* hDQ_Histogram = new TH1F(histname.c_str(), histtitle.c_str(), 
00103                                 10000, 0, 10000);
00104     hDQ_Histogram->GetXaxis()->SetTitle("Length [samples]");
00105     hDQ_Histogram->GetYaxis()->SetTitle("Number of Islands");
00106     DQ_IslandLength_histograms_map[bankname] = hDQ_Histogram;
00107 
00108     // The normalised histogram
00109     histname += "_normalised";
00110     histtitle += " (normalised)";
00111     TH1F* hDQ_Histogram_Normalised = new TH1F(histname.c_str(), histtitle.c_str(), 10000,0,10000);
00112     hDQ_Histogram_Normalised->GetXaxis()->SetTitle("Length [samples]");
00113     std::string yaxislabel = hDQ_Histogram->GetYaxis()->GetTitle();
00114     yaxislabel += " per TDC muSc Hit";
00115     hDQ_Histogram_Normalised->GetYaxis()->SetTitle(yaxislabel.c_str());
00116     DQ_IslandLength_histograms_normalised_map[bankname] = hDQ_Histogram_Normalised;
00117   }
00118 
00119   gDirectory->Cd("/MidasHists/");
00120   return SUCCESS;
00121 }


Variable Documentation

Map of bank name to histogram of TPI lengths per event.

Definition at line 60 of file MDQ_IslandLength.cpp.

Referenced by MDQ_IslandLength(), and MDQ_IslandLength_init().

Same as DQ_IslandLength_histograms_map but normalized to number of muons according to TDC.

Definition at line 61 of file MDQ_IslandLength.cpp.

Referenced by MDQ_IslandLength(), MDQ_IslandLength_eor(), and MDQ_IslandLength_init().

Object to hold data used and produced by modules throughout alcapana stage of analysis.

Definition at line 76 of file analyzer.cpp.

Hardware information about digitizers and detectors to be used during alcapana stage of analysis.

Definition at line 80 of file analyzer.cpp.

HNDLE hDB

Coount of number of muSc hits in a run in the TDC.

Definition at line 84 of file MDQ_TDCCheck.cpp.

Initial value:
{
        "MDQ_IslandLength",                    
        "Nam Tran",              
        MDQ_IslandLength,                      
        NULL,                          
        MDQ_IslandLength_eor,                          
        MDQ_IslandLength_init,                 
        NULL,                          
        NULL,                          
        0,                             
        NULL,                          
}

Definition at line 65 of file MDQ_IslandLength.cpp.


Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1