Data users

The data users are user actions that use the data to fill histograms or to dump them in text or binary files or dump them in the screen. There is one user action for each of the five types of information objects (step, track, event, run and secondary tracks), and one user action for each of the four actions, making in total twenty user actions. There is also a user action to dump data in a ROOT Tree; its behaviour is explained in a dedicated section below. We will describe in this section the available data users and how they behave with the different data types mentioned above.

The data can also be used to filter on an interval of values, in classifiers to give a different classification index in different user-defined intervals and in scorers to score the data values. These three usages are explained in the corresponding sections.

The behaviour of each of the data users depends on one side on the type of information object they manage and on the other side on the type of output provided.

Behaviour as a function of information object

The behaviour of each of the data users for each of the information objects is the following:

Note: the data of type Initial is printed (or used to fill an histogram) at the end of track, event or run, with the aim of having together all the information relevant to an object. This behaviour can be changed, so that this data is print at the start with the parameter

/gamos/setParam DATA_USER_NAME:UseAtInitial 1

Behaviour as a function of output format

The behaviour of each of the data users for each of the output type provided is the following:

Selection of data list for a data user

Each data user has a default list of data, that we will enumerate below. This list can be changed with the parameter:

/gamos/setParam DATA_USER_NAME:DataList DATA_1 DATA_2 ...

For example, if we use:

/gamos/userAction GmStepDataBinFileUA GmGammaFilter

the data list may be changed with the parameter:

/gamos/setParam GmStepDataBinFileUA_GmGammaFilter:DataList TrackID FinalPosX sqrt(2*FinalPosX*FinalPosY) InitialKineticEnergy

Default data list for each data user

The default data list of each of the fifteen data users are:

  • FinalPosX

  • FinalPosY

  • FinalPosZ

  • FinalMomX

  • FinalMomY

  • FinalMomZ

  • AccumulatedEnergyLost

  • AccumulatedEnergyDeposited

  • EventID

  • TrackID

  • Particle

  • FinalPosX

  • FinalPosY

  • FinalPosZ

  • FinalMomX

  • FinalMomY

  • FinalMomZ

  • AccumulateEnergyLost

  • AccumulateEnergyDeposited

  • EventID

  • TrackID

  • Particle

  • FinalPosX

  • FinalPosY

  • FinalPosZ

  • FinalMomX

  • FinalMomY

  • FinalMomZ

  • AccumulateEnergyLost

  • AccumulateEnergyDeposited

  • FinalPosX

  • FinalPosY

  • FinalPosZ

  • FinalMomX

  • FinalMomY

  • FinalMomZ

  • AccumulatedEnergyLost

  • AccumulatedEnergyDeposited

  • EventID

  • TrackID

  • Particle

  • FinalPosX

  • FinalPosY

  • FinalPosZ

  • FinalMomX

  • FinalMomY

  • FinalMomZ

  • AccumulateEnergyLost

  • AccumulateEnergyDeposited

  • EventID

  • TrackID

  • Particle

  • FinalPosX

  • FinalPosY

  • FinalPosZ

  • FinalMomX

  • FinalMomY

  • FinalMomZ

  • AccumulateEnergyLost

  • AccumulateEnergyDeposited

  • AccumulateEnergyLost

  • AccumulatedEnergyDeposited

  • EventID

  • AccumulateEnergyLost

  • AccumulatedEnergyDeposited

  • EventID

  • AccumulateEnergyLost

  • AccumulatedEnergyDeposited

  • AccumulateEnergyLost

  • AccumulatedEnergyDeposited

  • RunID

  • AccumulateEnergyLost

  • AccumulatedEnergyDeposited

  • RunID

  • AccumulateEnergyLost

  • AccumulatedEnergyDeposited

  • TrackID

  • InitialPrimMinusSecoKineticEnergy

  • FinalPrimMinusSecoKineticEnergy

  • SecoDividedInitialPrimKineticEnergy

  • SecoKineticEnergy

  • PrimSecoAngleChange

  • InitialPrimKineticEnergy

  • FinalPrimKineticEnergy

  • EventID

  • TrackID

  • InitialPrimMinusSecoKineticEnergy

  • FinalPrimMinusSecoKineticEnergy

  • SecoDividedInitialPrimKineticEnergy

  • SecoKineticEnergy

  • PrimSecoAngleChange

  • InitialPrimKineticEnergy

  • FinalPrimKineticEnergy

  • TrackID

  • InitialPrimMinusSecoKineticEnergy

  • FinalPrimMinusSecoKineticEnergy

  • SecoDividedInitialPrimKineticEnergy

  • SecoKineticEnergy

  • PrimSecoAngleChange

  • InitialPrimKineticEnergy

  • FinalPrimKineticEnergy

Saving GAMOS data in a ROOT TTree

The GmDataTTreeUA data user sorts GAMOS data in a ROOT TTree structure and save the new TTree in a ROOT TFile. The GmDataTTreeUA is invoked with the usual command:

/gamos/userAction GmDataTTreeUA

By default the TTree is created with the GmDataTTree name and saved in the GmDat aTTree.root file. The following command can be used to modify both both TFile and TTree names:

/gamos/setParam DATA_USER_NAME:TreeFileName NEW_NAME

Four categories of GAMOS data can be saved in the TTree: Event data, Track data, Secondary Track data, and Step data. GAMOS users can s elect one list of data for each one of the four categories. If data with no meaning for a given category are included in the correspondent list (e.g. adding trackID data to the Event data list), an exception will be returned. By default, the four data lists are empty and nothi ng is saved in the TTree unless otherwise specified. The four data lists are selected as follows:

/gamos/setParam DATA_USER_NAME:EventDataList EVENT_DATA_1 EVENT_DATA_2 ...

/gamos/setParam DATA_USER_NAME:TrackDataList TRACK_DATA_1 TRACK_DATA_2 ...

/gamos/setParam DATA_USER_NAME:SecondaryTrackDataList SECO_DATA_1 SECO_DATA_2 ...

/gamos/setParam DATA_USER_NAME:StepDataList STEP_DATA_1 STEP_DATA_2 ...

DATA_USER_NAME is the name of the user action, i.e. the word GmDataTreeUA plus the name of filters and classifier

The TTree is filled at the end of each GAMOS event and contains a number of entries equal to the number of simulated events. Each of the selected GAMOS data is stored in an independent TBranch inside the TTree.

Data are saved as integers, doubles, or strings. For each TTree entry, each of the selected GAMOS data is stored in a std::vector, apart from Event data that correspond to single values. The size of a std::vector varies in accordance with the corresponding category: track data vectors contain a number of elements equal to the number of tracks for a given event; step and secondary track data vectors equal to the number of steps for the same event.

Filter from data

It is possible to use any GAMOS data to filter on its value (see chapter on Filters). To use it you have to use the command to define a filter, using the filter named GmNumericDataFilter if the data is of numeric type (int or float) and GmStringDataFilter if the data is of string type and passing the following arguments:

GmNumericDataFilter: In this case after the filter name you have to give the the minimum and maximum value of the data. For example:

/gamos/filter dataF GmNumericDataFilter InitialKineticEnergy 0. 0.3

GmStringDataFilter: In this case after the filter name, you have to give the list of accepted values. For example:

/gamos/filter dataF GmStringDataFilter InitialLogicalVolume detector world

Classifier by data

It is possible to use any GAMOS data to classify on its value (see chapter on Classifiers). To use it you have to use the command to define a classiifier, using the classifier named GmClassifierByNumericData if the data is of numeric type (int or float) and GmClassifierByStringData if the data is of string type and passing the following arguments:

Primitive scorer from data

It is possible to use any GAMOS data, if its type is interger of float, to build an scorer on its value (see chapter on Scorers). To use it you have to use the command to define a scorer, using the scorer named GmG4PSData and passing to it the data name and the minimum and maximum value of the data. For example:

/gamos/scoring/createMFDetector contDet container

/gamos/scoring/addScorer2MFD dataScorer GmG4PSData contDet InitialKineticEnergy