Commit e5b5612c authored by dino's avatar dino
Browse files

More checks in the size of buffers in femul

The topology files for femul should now have the name of the mother class; like done in narval, femul takes the daughter class from the configuration file.
Keyword AcceptanceLimit in TrackingFilter has now two parameters to better control behaviour of OFT 
Added files with scattering cross sections for MGT in .../agapro/filters/Tracking/includeMGT
PostPsaFilter moves the integer part of the signal position inside the captured short trace (as determined by PreprocessingFilterPSA and PSAFilterGridSeatch) to the timestamp. This improves quite a lot the timing done using only timestamps, allowing for narrower time windows in the EventBuilder and EventMerger

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1133 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 41b98920
This diff is collapsed.
......@@ -189,6 +189,7 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
unsigned int osiz = 0; // used length of output buffers
unsigned int osizMax = ((osize/4)*9)/10; // never fill more than 90%
obufFull = false;
ULong64_t firstTstamp = 0;
while(goAhead) {
......@@ -303,6 +304,8 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
oevCount++;
cServer.Exec(minTstamp);
if(firstTstamp == 0)
firstTstamp = minTstamp;
}
if(osiz > osizMax) {
obufFull = true;
......@@ -315,16 +318,17 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
*error_code = 0;
LOCK_COUT;
cServer.Prompt(-1, oevCount, *used_osize, !verbose);
const int chainsPerLine = 6;
cServer.Prompt(-1, oevCount, *used_osize, false);
cout << " tst = " << fixed << setprecision(1) << setw(8) << firstTstamp/double(tst1second);
const int chainsInPromptLine = 6;
if(verbose) {
if(nchains > chainsPerLine) cout << endl << " ";
if(nchains > chainsInPromptLine) cout << endl << " ";
cout << " {";
for(UInt_t nn = 0; nn < nchains; nn++) {
cout << " " << setw(5) << iqueSize[nn];
}
cout << " |";
if(nchains > chainsPerLine) cout << endl << " |";
if(nchains > chainsInPromptLine) cout << endl << " |";
for(UInt_t nn = 0; nn < nchains; nn++) {
cout << " " << setw(5) << evq[nn].numEvts;
}
......@@ -333,6 +337,9 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
cout << " **";
cout << endl;
}
else {
cout << endl;
}
if(oevCount > 0)
noBuild1 = noBuild2 = 0;
......
......@@ -58,8 +58,8 @@ public:
rotMat[0][0] = rotMat[1][1] = rotMat[2][2] = 1.f;
}
void RotX(float adeg) {
float xcos = cos(adeg*DEG2RAD);
float xsin = sin(adeg*DEG2RAD);
float xcos = float(cos(adeg*DEG2RAD));
float xsin = float(sin(adeg*DEG2RAD));
memset(rotTmp, 0, sizeof(rotTmp));
rotTmp[0][0] = 1.f;
rotTmp[1][1] = rotTmp[2][2] = float(xcos);
......@@ -68,8 +68,8 @@ public:
matMult3D((float *)rotTmp, (float *)rotMat, (float *)rotMat);
}
void RotY(float adeg) {
float xcos = cos(adeg*DEG2RAD);
float xsin = sin(adeg*DEG2RAD);
float xcos = float(cos(adeg*DEG2RAD));
float xsin = float(sin(adeg*DEG2RAD));
memset(rotTmp, 0, sizeof(rotTmp));
rotTmp[1][1] = 1.f;
rotTmp[2][2] = rotTmp[0][0] = float(xcos);
......@@ -78,8 +78,8 @@ public:
matMult3D((float *)rotTmp, (float *)rotMat, (float *)rotMat);
}
void RotZ(float adeg) {
float xcos = cos(adeg*DEG2RAD);
float xsin = sin(adeg*DEG2RAD);
float xcos = float(cos(adeg*DEG2RAD));
float xsin = float(sin(adeg*DEG2RAD));
memset(rotTmp, 0, sizeof(rotTmp));
rotTmp[2][2] = 1.f;
rotTmp[0][0] = rotTmp[1][1] = float(xcos);
......
......@@ -700,11 +700,27 @@ Int_t PostPSAFilter::Process()
}
}
// 12)
if(fShiftTimeCC) {
CoreT[0] += fShiftTimeCC*0.1f;
CoreT[1] += fShiftTimeCC*0.1f;
// 12) fix the timing
CoreT[0] += fShiftTimeCC*0.1f;
//CoreT[1] += fShiftTimeCC*0.1f; // leave here the old value
#if 1
// Move the integer part of the trace position to the timestamp, removing most of the
// time-walk due to the use of a LE trigger in the preprocessing elctronics.
// CoreT[0] holds the fractional part; CoreT[1] is left unchanged for control purposes
const float T0 = 40.f; // final position of data
float tpos = CoreT[0] - T0 ; // in samples
if(tpos >= 0) {
int itst = int(tpos + 0.5f);
timestamp += itst;
tpos -= itst;
}
else {
int itst = int(-tpos + 0.5f);
timestamp -= itst;
tpos += itst;
}
CoreT[0] = tpos + T0; // no change to CoreT[1]
#endif
// 13)
if(fForceSegmentsToCore) {
......
......@@ -158,7 +158,8 @@ TrackingFilter::TrackingFilter() :
rVx = rVy = rVz = rVc = 0;
aPx = aPy = aPz = 0;
fAcceptanceValue = 0; // 0 is recognized by the daughter class as default
fAcceptanceValue1 = 0; // 0 is recognized by the daughter class as default
fAcceptanceValue2 = 0; // 0 is recognized by the daughter class as default
fGeometrySummary = "235.008 329.202 15 3 6 6 6 6 6 6";
fp_conf = NULL;
......@@ -1430,8 +1431,13 @@ void TrackingFilter::GetParameters(UInt_t *error_code)
#endif
KEND;
KPAR("AcceptanceValue", "%f", "quality of tracking");
ok = 1 == sscanf(data.c_str(), "%f", &fAcceptanceValue);
KPAR("AcceptanceValue", "%f %f", "quality of tracking");
float v1=0, v2=0;
int nn;
nn = sscanf(data.c_str(), "%f %f", &v1, &v2);
if(nn >= 1) fAcceptanceValue1 = v1;
if(nn >= 2) fAcceptanceValue2 = v2;
ok = (nn >= 1);
KEND;
KPAR("CoreEnergyGate", "%f %f", "acceptance window on core energy (keV)");
......
......@@ -297,7 +297,8 @@ protected:
float fSource[3]; // x y z in mm
float fAcceptanceValue;
float fAcceptanceValue1;
float fAcceptanceValue2;
std::string fGeometrySummary;
void InitGenStructures();
......
......@@ -70,7 +70,7 @@ Int_t TrackingFilterMGT::AlgoSpecificInitialise()
// As c_str() gives back a const char*, g++ complains of passing a const to a C function that does
// have this signature (even if we know that mgt_initialize does not modify it).
// It can be done also by explicit copy to a char* (see csummary) but const_cast does it better
mgt_initialize(fAcceptanceValue, const_cast<char *>(("SUMMARY " + fGeometrySummary).c_str()));
mgt_initialize(fAcceptanceValue1, const_cast<char *>(("SUMMARY " + fGeometrySummary).c_str()));
//delete [] csummary;
......
......@@ -12,17 +12,17 @@ using namespace ADF;
#ifdef _MSC_VER // *.c stuff compiled using C
extern "C" {
void process_event(OftStruct *mydata, unsigned int *error_code);
void initialize_oft(double probLimit);
void initialize_oft(double probLimit1, double probLimit2);
}
#else
#if DO_OFT != ON // internal cmake force C++ compilation
extern "C" {
void process_event(OftStruct *mydata, unsigned int *error_code);
void initialize_oft(double probLimit);
void initialize_oft(double probLimit1, double probLimit2);
}
#else // *.c stuff compiled using C++
void process_event(OftStruct *mydata, unsigned int *error_code);
void initialize_oft(double probLimit);
void initialize_oft(double probLimit1, double probLimit2);
#endif
#endif
......@@ -109,7 +109,7 @@ Int_t TrackingFilterOFT::AlgoSpecificInitialise()
local_ptr->mult = 0;
local_ptr->nb_int = 0;
initialize_oft(fAcceptanceValue);
initialize_oft(fAcceptanceValue1, fAcceptanceValue2);
return 0;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -24,16 +24,18 @@ double minprobtrack = 0.05; /* threshold for track acceptance */
double minprobsing = 0.15; /* threshold for single int acceptance */
// precalculation of cross sections
// and "macrification" of some function calls
// and "macro-fication" of some function calls
void initialize_cluster(double probLimit)
void initialize_cluster(double probLimit1, double probLimit2)
{
int nn;
double ee;
if(probLimit > 0 && probLimit <= 1) {
minprobtrack = probLimit;
minprobsing = 3*minprobtrack < 1. ? 3*minprobtrack : 1.; // ??
if(probLimit1 > 0 && probLimit1 <= 1) {
minprobtrack = probLimit1;
}
if(probLimit2 > 0 && probLimit2 <= 1) {
minprobsing = probLimit2;
}
for(nn = 0; nn < EMAXKEV; nn++) {
......
......@@ -57,6 +57,6 @@ int cluster_validation(double etot[intmax],
posi3D first[intmax],
posi3D second[intmax]);
void initialize_cluster(double probLimit);
void initialize_cluster(double probLimit1, double probLimit2);
#endif
......@@ -64,12 +64,12 @@ typedef struct {
#define kmax 7 /* max number of interactions for a given incident gamma-ray
* Si >7, pbme de performance dans evaluation des clusters Compton */
#define min_opening_angle 0.15 /* minimum value of the cluster search angle */
#define step_in_opening_angle 0.10 /* step in angle for cluster serach */
#define step_in_opening_angle 0.10 /* step in angle for cluster search */
#define eres 3e-3 /* energy resolution */
#define eresSQ 9e-6 /* SQ(energy resolution) */
#define photodistmax 4 /* min distance in cm between 2 points to process single int. point */
//#define minprobtrack 0.05 /* threshold for track acceptance */
//#define minprobsing 0.15 /* threshold for single int acceptance */
//#define minprobtrack 0.05 /* threshold for track acceptance */ // now a variable in tracking_cluster.c
//#define minprobsing 0.15 /* threshold for single int acceptance */ // now a variable in tracking_cluster.c
#define intmax 800 /* max of interaction points per event */
#define EMAXKEV 100000
......
......@@ -148,9 +148,9 @@ void process_event(OftStruct *mydata, unsigned int *error_code) {
*error_code = 0;
}
void initialize_oft(double probLimit)
void initialize_oft(double probLimit1, double probLimit2)
{
initialize_cluster(probLimit);
initialize_cluster(probLimit1, probLimit2);
}
......@@ -5,7 +5,7 @@
#include "tracking_define.h"
void process_event(OftStruct *, unsigned int *);
void initialize_oft(double probLimit);
void initialize_oft(double probLimit1, double probLimit2);
#endif
......@@ -259,7 +259,7 @@ void AncillaryProducerTCP::GetParameters(uint32_t *error_code)
ok = 1 == sscanf(data.c_str(), "%d", &fDetectorID);
KEND;
KPAR("TcpPort", "%d", "tcp port (usually 999)");
KPAR("PortTCP", "%d", "tcp port (usually 999)");
ok = 1 == sscanf(data.c_str(), "%d", &fTcpPort);
KEND;
......
CrystalProducer "ActualClass"
CrystalProducer "ReadDataDir" "ReadDataPrefix"
CrystalProducer "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
CrystalProducer "TstampCorrection"
CrystalProducer "CrystalID"
CrystalProducer "WriteDataMask"
CrystalProducer "DecimateMezzdata" "Decimate_mezzdata"
CrystalProducer "DecimateMezzener" "Decimate_mezzener"
CrystalProducer "WriteCompressed"
CrystalProducer "WriteUnCompressed"
CrystalProducer "WriteDataRange"
CrystalProducer "WriteDataSplit"
CrystalProducer "InputDataFile"
CrystalProducer "NumInputFiles"
CrystalProducer "AllInputFiles"
CrystalProducer "TraceLength"
CrystalProducer "ValidationRate" "TriggerRate"
CrystalProducer "WriteTraces"
CrystalProducer "WriteBaseLines"
CrystalProducer "ProjeM1"
CrystalProducer "TimeStep"
CrystalProducer "MaxTstampSeconds"
CrystalProducer "StopErrorCode"
CrystalProducer "NoMultiHist" "NoLocalSpectra"
CrystalProducer "Verbose"
PreprocessingFilter "ActualClass"
PreprocessingFilter "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
PreprocessingFilter "XtalkFile"
PreprocessingFilter "TraceLengthRaw"
PreprocessingFilter "WriteTraces"
PreprocessingFilter "EnergyGain"
PreprocessingFilter "CoreEnergyGate"
PreprocessingFilter "SegmentEnergyThreshold"
PreprocessingFilter "SegmentFoldGate"
PreprocessingFilter "CFDparamsCC"
PreprocessingFilter "TriggerWithCoreAlone"
PreprocessingFilter "DeadSegment"
PreprocessingFilter "UnstableSegment"
PreprocessingFilter "NoMultiHist" "NoLocalSpectra"
PreprocessingFilter "Verbose"
PSAFilter "ActualClass"
PSAFilter "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
PSAFilter "BasisFile"
PSAFilter "XtalkFile"
PSAFilter "NoMultiHist" "NoLocalSpectra"
PSAFilter "MatrXYZR" "XYZRmatr"
PSAFilter "DistanceMetric"
PSAFilter "GridSearch" "GridSearchType"
PSAFilter "NoFitTZero"
PSAFilter "Threads"
PSAFilter "WriteTraces"
PSAFilter "WritePsaHits"
PSAFilter "EnergyGain"
PSAFilter "CoreEnergyGate"
PSAFilter "SegmentFoldGate"
PSAFilter "DeadSegment"
PSAFilter "TauSlice"
PSAFilter "Verbose"
PostPSAFilter "ActualClass"
PostPSAFilter "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
PostPSAFilter "WritePsaHits"
PostPSAFilter "CoreEnergyGate"
PostPSAFilter "SegmentFoldGate"
PostPSAFilter "NumberOfHitsGate"
PostPSAFilter "EnergyGain"
PostPSAFilter "LambdaE"
PostPSAFilter "LambdaH"
PostPSAFilter "TrappingFile"
PostPSAFilter "SmearPos"
PostPSAFilter "RecalCC"
PostPSAFilter "RecalSG"
PostPSAFilter "ShiftCC"
PostPSAFilter "ForceSegmentsToCore"
PostPSAFilter "NoMultiHist" "NoLocalSpectra"
PostPSAFilter "Verbose"
AncillaryProducerTCP "ActualClass"
AncillaryProducerTCP "ReadDataDir" "ReadDataPrefix"
AncillaryProducerTCP "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
AncillaryProducerTCP "KeyADF" "AdfKey"
AncillaryProducerTCP "WriteDataMask"
AncillaryProducerTCP "DetectorID"
AncillaryProducerTCP "TcpPort" "PortTCP"
AncillaryProducerTCP "TcpLittleEndian"
AncillaryProducerTCP "EndEventTag"
AncillaryProducerTCP "InputDataFile"
AncillaryProducerTCP "RawXDaq"
AncillaryProducerTCP "EventsPerBlock"
AncillaryProducerTCP "Verbose"
AncillaryFilter "ActualClass"
AncillaryFilter "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
AncillaryFilter "AllPairsMat"
AncillaryFilter "PRISMALUTFile"
AncillaryFilter "PRISMAManager"
AncillaryFilter "WriteRootTree"
AncillaryFilter "TstampFile"
AncillaryFilter "DanteChan"
AncillaryFilter "DantePos"
AncillaryFilter "DanteBeta"
AncillaryFilter "DanteCalX"
AncillaryFilter "DanteCalY"
AncillaryFilter "ReferenceTDC"
AncillaryFilter "DanteTDC"
AncillaryFilter "PrismaTDC"
AncillaryFilter "NoMultiHist" "NoLocalSpectra"
AncillaryFilter "Verbose"
EventBuilder "ActualClass"
EventBuilder "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
EventBuilder "BuilderType"
EventBuilder "KeyIn"
EventBuilder "KeyOut"
EventBuilder "MinFold"
EventBuilder "TimestampCorrect"
EventBuilder "NoMultiHist" "NoLocalSpectra"
EventBuilder "Verbose"
GlobalFilter "ActualClass"
GlobalFilter "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
GlobalFilter "Ancillary"
GlobalFilter "Recoiling"
GlobalFilter "RotoTranslations"
GlobalFilter "GeometrySummary"
GlobalFilter "RecoilBeta"
GlobalFilter "RecoilDirection"
GlobalFilter "SourcePosition"
GlobalFilter "KeepEmpty"
GlobalFilter "DiscardEmpty"
GlobalFilter "EnergyGain"
GlobalFilter "CoreEnergyGate"
GlobalFilter "SumEnergyGate"
GlobalFilter "DetectorFoldGate"
GlobalFilter "WriteMgtHits" "WriteMgtData" "WriteOftHits" "WriteInputHits"
GlobalFilter "WriteRootTree"
GlobalFilter "WriteGsortData"
GlobalFilter "WriteTracked"
GlobalFilter "TimeWindowGeAnc" "TimeWindowGeAncillary"
GlobalFilter "Matrixgg1"
GlobalFilter "Matrixgg2"
GlobalFilter "NoMultiHist" "NoLocalSpectra"
GlobalFilter "Verbose"
GlobalFilter "Debug"
TrackingFilter "ActualClass"
TrackingFilter "SaveDataDir" "WriteDataDir" "WriteDataPrefix"
TrackingFilter "ExcludeTracking"
TrackingFilter "Ancillary"
TrackingFilter "AncillaryRawFrame"
TrackingFilter "Recoiling"
TrackingFilter "RotoTranslations"
TrackingFilter "GeometrySummary"
TrackingFilter "RecoilBeta"
TrackingFilter "RecoilDirection"
TrackingFilter "SourcePosition"
TrackingFilter "KeepEmpty"
TrackingFilter "DiscardEmpty"
TrackingFilter "OutputModel"
TrackingFilter "AcceptanceValue"
TrackingFilter "EnergyGain"
TrackingFilter "CoreEnergyGate"
TrackingFilter "SumEnergyGate"
TrackingFilter "DetectorFoldGate"
TrackingFilter "WriteMgtHits" "WriteMgtData" "WriteOftHits" "WriteInputHits"
TrackingFilter "WriteRootTree"
TrackingFilter "WriteGsortData"
TrackingFilter "WriteTracked"
TrackingFilter "TimeWindowGeAnc" "TimeWindowGeAncillary"
TrackingFilter "Matrixgg1"
TrackingFilter "Matrixgg2"
TrackingFilter "NoMultiHist" "NoLocalSpectra"
TrackingFilter "Verbose"
TrackingFilter "Debug"
This diff is collapsed.
Chain 2 1R/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 1G/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 1B/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 2R/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 2G/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 2B/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 3R/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 3G/
Producer BasicAFP 100000
Dispatcher EventBuilder
Chain 2 3B/
Producer BasicAFP 100000
Dispatcher EventBuilder
LOOP CRYS 1R 1G 1B 2R 2G 2B 3R 3G 3B
Chain 2 CRYS
Producer BasicAFP 100000
Dispatcher EventBuilder
ENDLOOP
#Chain 3 Global/
#Builder EventBuilder 500000
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment