src/common/MNumberIslands.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <map>
#include <utility>
#include <sstream>
#include "midas.h"
#include <TH2.h>
#include "TOctalFADCIsland.h"
#include "TOctalFADCBankReader.h"
#include "TGlobalData.h"
#include "TSetupData.h"
#include "TPulseIsland.h"

Go to the source code of this file.

Functions

INT MNumberIslands_init (void)
INT MNumberIslands (EVENT_HEADER *, void *)
double GetClockTickForChannel (string bank_name)

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.
static vector
< TOctalFADCBankReader * > 
fadc_bank_readers
static TH2I * hNumberOfIslands
ANA_MODULE MNumberIslands_module

Function Documentation

double GetClockTickForChannel ( string  bank_name  ) 
INT MNumberIslands ( EVENT_HEADER *  pheader,
void *  pevent 
)

This method processes one MIDAS block, producing a vector of TOctalFADCIsland objects from the raw Octal FADC data.

Definition at line 81 of file MNumberIslands.cpp.

References TGlobalData::fPulseIslandToChannelMap, and hNumberOfIslands.

00082 {
00083         // Get the event number
00084         int midas_event_number = pheader->serial_number;
00085 
00086         // Some typedefs
00087         typedef map<string, vector<TPulseIsland*> > TStringPulseIslandMap;
00088         typedef pair<string, vector<TPulseIsland*> > TStringPulseIslandPair;
00089         typedef map<string, vector<TPulseIsland*> >::iterator map_iterator;
00090 
00091         // Fetch a reference to the gData structure that stores a map
00092         // of (bank_name, vector<TPulseIsland*>) pairs
00093         TStringPulseIslandMap& pulse_islands_map =
00094                 gData->fPulseIslandToChannelMap;
00095 
00096         // Loop over the map and get each bankname, vector pair
00097         for (map_iterator theMapIter = pulse_islands_map.begin(); theMapIter != pulse_islands_map.end(); theMapIter++) 
00098         {
00099           std::string bankname = theMapIter->first;
00100           std::vector<TPulseIsland*> thePulses = theMapIter->second;
00101         
00102           hNumberOfIslands->Fill(bankname.c_str(), midas_event_number, thePulses.size());
00103 
00104         }
00105         return SUCCESS;
00106 }

INT MNumberIslands_init (  ) 

This method initializes histograms.

Definition at line 64 of file MNumberIslands.cpp.

References hNumberOfIslands.

00065 {
00066   // This histogram has the pulse counters on the X-axis and the number of pulses on the Y-axis
00067   // One histogram is created for each detector
00068 
00069 
00070   hNumberOfIslands = new TH2I("hNumberOfIslands", "Number of Islands per Channel per Event", 1,0,1, 10000,0,10000);
00071   hNumberOfIslands->GetXaxis()->SetTitle("Bank Name");
00072   hNumberOfIslands->GetYaxis()->SetTitle("MIDAS Event Number");
00073   hNumberOfIslands->SetBit(TH1::kCanRebin);
00074 
00075   return SUCCESS;
00076 }


Variable Documentation

vector<TOctalFADCBankReader*> fadc_bank_readers [static]

Definition at line 45 of file MNumberIslands.cpp.

HNDLE hDB
TH2I* hNumberOfIslands [static]

Definition at line 46 of file MNumberIslands.cpp.

Referenced by MNumberIslands(), and MNumberIslands_init().

Initial value:
{
        "MNumberIslands",                    
        "Andrew Edmonds",              
        MNumberIslands,                      
        NULL,                          
        NULL,                          
        MNumberIslands_init,                 
        NULL,                          
        NULL,                          
        0,                             
        NULL,                          
}

Definition at line 48 of file MNumberIslands.cpp.


Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1