MDQ_RunTime
[Low Level Data Quality Checks]

Records run time according to the ODB. More...

Functions

INT MDQ_RunTime_init (void)
INT MDQ_RunTime (EVENT_HEADER *, void *)
INT MDQ_RunTime_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.
TH1F * hDQ_RunTime
 Simply a single value representing run time according to ODB.
ANA_MODULE MDQ_RunTime_module

Detailed Description

Records run time according to the ODB.

Author:
Andrew Edmonds

Records run time in hDQ_RunTime.


Function Documentation

INT MDQ_RunTime ( EVENT_HEADER *  pheader,
void *  pevent 
)

This method fills the histograms

Definition at line 149 of file MDQ_RunTime.cpp.

00150 {
00151         // Get the event number
00152         int midas_event_number = pheader->serial_number;
00153 
00154         // Some typedefs
00155         typedef map<string, vector<TPulseIsland*> > TStringPulseIslandMap;
00156         typedef pair<string, vector<TPulseIsland*> > TStringPulseIslandPair;
00157         typedef map<string, vector<TPulseIsland*> >::iterator map_iterator;
00158 
00159         // Don't need anything here
00160 
00161         return SUCCESS;
00162 }

INT MDQ_RunTime_eor ( INT  run_number  ) 

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

Definition at line 95 of file MDQ_RunTime.cpp.

References hDB, and hDQ_RunTime.

00095                                     {
00096 
00097   // Get the run duration to scale the histogram
00098   HNDLE hDB, hKey;
00099   char keyName[200];
00100 
00101   if(cm_get_experiment_database(&hDB, NULL) != CM_SUCCESS){
00102     printf("Warning: Could not connect to ODB database!\n");
00103     return false;
00104   }
00105 
00106   sprintf(keyName, "/Runinfo/Start time binary");
00107   if(db_find_key(hDB,0,keyName, &hKey) != SUCCESS){
00108     printf("Warning: Could not find key %s\n", keyName);
00109     return false;
00110   }
00111   KEY start_time_key;
00112   if(db_get_key(hDB, hKey, &start_time_key) != DB_SUCCESS){
00113     printf("Warning: Could not find key %s\n", keyName);
00114     return false;
00115   }
00116   DWORD StartTimes[start_time_key.num_values];
00117   int size = sizeof(StartTimes);
00118   if(db_get_value(hDB, 0, keyName, StartTimes, &size, TID_DWORD, 0) != DB_SUCCESS){
00119     printf("Warning: Could not retrieve values for key %s\n", keyName);
00120     return false;
00121   }
00122 
00123   sprintf(keyName, "/Runinfo/Stop time binary");
00124   if(db_find_key(hDB,0,keyName, &hKey) != SUCCESS){
00125     printf("Warning: Could not find key %s\n", keyName);
00126     return false;
00127   }
00128   KEY stop_time_key;
00129   if(db_get_key(hDB, hKey, &stop_time_key) != DB_SUCCESS){
00130     printf("Warning: Could not find key %s\n", keyName);
00131     return false;
00132   }
00133   DWORD StopTimes[stop_time_key.num_values];
00134   size = sizeof(StopTimes);
00135   if(db_get_value(hDB, 0, keyName, StopTimes, &size, TID_DWORD, 0) != DB_SUCCESS){
00136     printf("Warning: Could not retrieve values for key %s\n", keyName);
00137     return false;
00138   }
00139 
00140   int duration = StopTimes[0] - StartTimes[0]; // length of run in seconds (checked against run #2600)
00141 
00142   hDQ_RunTime->Fill(1,duration);
00143 
00144   return SUCCESS;
00145 }

INT MDQ_RunTime_init (  ) 

This method initializes histograms.

Definition at line 71 of file MDQ_RunTime.cpp.

References hDQ_RunTime.

00072 {
00073     // See if the DataQuality_LowLevel/ directory already exists
00074   if (!gDirectory->Cd("DataQuality_LowLevel")) {
00075     
00076     std::string dir_name("DataQuality_LowLevel/");
00077     gDirectory->mkdir(dir_name.c_str());
00078     gDirectory->Cd(dir_name.c_str());
00079   }
00080 
00081   // hDQ_RunTime
00082   std::string histname = "hDQ_RunTime";
00083   std::string histtitle = "The duration of the run";
00084   hDQ_RunTime = new TH1F(histname.c_str(), histtitle.c_str(), 3,0,3);
00085   hDQ_RunTime->GetXaxis()->SetTitle("");
00086   hDQ_RunTime->GetYaxis()->SetTitle("Run Time [s]");
00087 
00088 
00089   gDirectory->Cd("/MidasHists/");
00090   return SUCCESS;
00091 }


Variable Documentation

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

Simply a single value representing run time according to ODB.

Definition at line 53 of file MDQ_RunTime.cpp.

Referenced by MDQ_RunTime_eor(), and MDQ_RunTime_init().

ANA_MODULE MDQ_RunTime_module
Initial value:
{
        "MDQ_RunTime",                    
        "Andrew Edmonds",              
        MDQ_RunTime,                      
        NULL,                          
        MDQ_RunTime_eor,                          
        MDQ_RunTime_init,                 
        NULL,                          
        NULL,                          
        0,                             
        NULL,                          
}

Definition at line 55 of file MDQ_RunTime.cpp.


Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1