PLASTIC FATIMA Processor - PNapi90/DESPEC-Analysis-Framework GitHub Wiki

The Plastic Fatima Processor (PL_FAT_EventProcessor.cxx) is used to create histograms of coincident PLASTIC-FATIMA Events. The data of the coincident events is fetched via the functions PassEvent_PLASTIC(PLASTIC_DataStruct* DATA_P) and PassEvent_FATIMA(FATIMA_DataStruct* DATA_F). All necessary kinds of data can be saved in the respective data structs filled in Raw_Event. Different kinds of histograms can be created in the class' constructor and are filled inside the ProcessEvent() function called by the Event_Store class during the Event Building.

Defining new Processors

To define additional event processors, the respective type has to be defined in the Configuration_Files/CoincidenceMaps.txt file (example see below).

#
# Define Processor Map for different coincidence types 
#
# (types: FRS = 0,AIDA = 1,PLASTIC = 2,FATIMA = 3,GALILEO = 4,FINGER = 5) 
# 
# ======================================================
# DATA TYPES HAVE TO BE IN ASCENDING ORDER!
# ======================================================
#
# files sorted like:
# Processor ID | amount of coincidences | types ...
#
0	2	2	3

Each user defined processor gets a unique Processor ID (here 0) which is used in Event_Store.cxx . Each type has to be included in the switch(ID) as a new case, where the case's number is identical to the defined Processor ID.

void Event_Store::ProcessCreator(int ID){
    
    //set Processor IDs here (defined in CoincidenceMap file)
    switch(ID){
        case 0:
            PROCESSORS[ID] = new PL_FAT_EventProcessor();
            break;
        //case 1: //<- Define your Processors here
            //break;
            
        //case 2: //<- Define your Processors here
            //break;
        
        default:
            std::cerr << "Unknown Process ID " << ID << std::endl;
            std::cerr << "Defined types are: ";
            for(int i = 0;i < Process_Type[ID]->Length;++i){
                std::cerr << Process_Type[ID]->types[i] << " ";
            }
            std::cerr << std::endl;
            exit(1);
    }
}

In addition, each processor needs to "know" the amount of demanded coincident systems as well as the types of coincident systems (in ascending order).

In general, all user defined EventProcessors have to inherit from the abstract base class EventProcessor. All processor need to implement the virtual functions

virtual void PassEvent_FRS(FRS_DataStruct*) = 0;
virtual void PassEvent_AIDA(AIDA_DataStruct*) = 0;
virtual void PassEvent_PLASTIC_VME(PLASTIC_VME_DataStruct*) = 0;
virtual void PassEvent_PLASTIC(PLASTIC_DataStruct*) = 0;
virtual void PassEvent_FATIMA(FATIMA_DataStruct*) = 0;
virtual void PassEvent_GALILEO(GALILEO_DataStruct*) = 0;
virtual void PassEvent_FINGER(FINGER_DataStruct*) = 0;

virtual bool AllPassed() = 0;

Here, only the really needed PassEvent_* functions need to be implemented. Unnecessary functions can be simply defined as

void PassEvent_FRS(FRS_DataStruct* DATA_FRS)
{}

However, a sensible implementation of bool AllPassed() is necessary. In PL_FAT_EventProcessor, this is achieved via

bool PL_FAT_EventProcessor::AllPassed(){
    //check if all necessary events were passed
    if(PLASTIC_Passed && FATIMA_Passed){
        PLASTIC_Passed = false;
        FATIMA_Passed = false;

        ProcessEvent();

        return true;
    }
    std::cerr << "-----------------------------------------------\n";
    std::cerr << "*** PL_FAT_EventProcessor ***\n";
    std::cerr << "AllPassed called before all elements passed!\n";
    std::cerr << "-----------------------------------------------" << std::endl;
    
    return false;

}

Here, if all events have been passed to the processor, the ProcessEvent() function which fills the defined histograms is called. An error message in the unlikely case of if(PLASTIC_Passed && FATIMA_Passed) leading to false is advisory since the program is stopped in this case.