Skip to content

Commit

Permalink
MWPC and telescope time calibration. MWPC digi creating only eith time
Browse files Browse the repository at this point in the history
  • Loading branch information
SchetininVitaliy committed Sep 18, 2018
1 parent 04f520c commit 6329d3f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
14 changes: 6 additions & 8 deletions beamtime/unpack/ERBeamDetUnpack.cxx
Expand Up @@ -5,6 +5,7 @@
#include "TClonesArray.h"

#include "FairRootManager.h"
#include "FairLogger.h"

#include "DetEventFull.h"
#include "DetEventStation.h"
Expand All @@ -18,7 +19,7 @@ using namespace std;
//--------------------------------------------------------------------------------------------------
ERBeamDetUnpack::ERBeamDetUnpack(TString detName):
ERUnpack(detName),
fToFCalConst(0.125)
fTimeCalConst(0.125)
{

}
Expand Down Expand Up @@ -88,7 +89,7 @@ Bool_t ERBeamDetUnpack::DoUnpack(Int_t* data, Int_t size){
amp += itValue.second.first;
time += itValue.second.second;
}
time = time*0.25*fToFCalConst;
time = time*0.25*fTimeCalConst;
AddToFDigi(amp,time,1);
}
else
Expand All @@ -103,7 +104,7 @@ Bool_t ERBeamDetUnpack::DoUnpack(Int_t* data, Int_t size){
amp += itValue.second.first;
time += itValue.second.second;
}
time = time*0.25*fToFCalConst;
time = time*0.25*fTimeCalConst;
AddToFDigi(amp,time,2);
}
else
Expand All @@ -123,14 +124,11 @@ Bool_t ERBeamDetUnpack::DoUnpack(Int_t* data, Int_t size){
UnpackStation(detEvent, mwpcAmpSt, mwpcAmp);
if (mwpcTime.find(mwpcTimeSt) != mwpcTime.end()){
for (auto itChanel : mwpcAmp){
AddMWPCDigi(itChanel.second, mwpcTime[mwpcTimeSt], mwpcAmpSt, itChanel.first);
AddMWPCDigi(itChanel.second, mwpcTime[mwpcTimeSt]*fTimeCalConst, mwpcAmpSt, itChanel.first);
}
}
else{
cerr << "Could not find mwpc time station " << mwpcTimeSt << endl;
for (auto itChanel : mwpcAmp){
AddMWPCDigi(itChanel.second,0., mwpcAmpSt, itChanel.first);
}
LOG(DEBUG) << "MWPC time signal not found for amplitude" << FairLogger::endl;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion beamtime/unpack/ERBeamDetUnpack.h
Expand Up @@ -23,7 +23,7 @@ class ERBeamDetUnpack : public ERUnpack
std::map<TString,Int_t> fMwpcAmpTimeStations;
std::map<TString,TString> fMwpcBnames;

Double_t fToFCalConst;
Double_t fTimeCalConst;

public:
ClassDef(ERBeamDetUnpack, 0)
Expand Down
5 changes: 3 additions & 2 deletions beamtime/unpack/ERTelescopeUnpack.cxx
Expand Up @@ -18,7 +18,8 @@ using namespace std;

//--------------------------------------------------------------------------------------------------
ERTelescopeUnpack::ERTelescopeUnpack(TString detName):
ERUnpack(detName)
ERUnpack(detName),
fTimeCalConst(0.3)
{

}
Expand Down Expand Up @@ -300,7 +301,7 @@ Bool_t ERTelescopeUnpack::ApplyCalibration(TMatrixD* calTable, std::map<Int_t, s
return kFALSE;
}
itValue.second.first = itValue.second.first*(*calTable)[itValue.first][1] + (*calTable)[itValue.first][0];
cerr << itValue.second.first << endl;
itValue.second.second *= fTimeCalConst;
}

return kTRUE;
Expand Down
2 changes: 2 additions & 0 deletions beamtime/unpack/ERTelescopeUnpack.h
Expand Up @@ -60,6 +60,8 @@ class ERTelescopeUnpack : public ERUnpack
Bool_t CheckSetup();

std::map<TString,ERTelescopeStation*> fStations;

Double_t fTimeCalConst;
public:
ClassDef(ERTelescopeUnpack, 0)
};
Expand Down

0 comments on commit 6329d3f

Please sign in to comment.