18#include "FairRootManager.h"
19#include "FairRunAna.h"
20#include "FairRuntimeDb.h"
49using std::setprecision;
169 TF1* digiGausDist =
new TF1(
"digiGausDist",
"gaus", -5., 5.);
173 cout << endl <<
"-I- " << fName <<
": executing event" << endl;
174 cout <<
"----------------------------------------------" << endl;
184 cerr <<
"-W- " << fName <<
"::Exec: No input array (STSPoint) " << endl;
185 cout <<
"- " << fName << endl;
189 map<CbmStsSensor*, set<Int_t>>::iterator mapIt;
191 ((*mapIt).second).clear();
193 for (
Int_t iPoint = 0; iPoint <
fPoints->GetEntriesFast(); iPoint++) {
205 cerr <<
"-E- " << fName <<
"::Exec:: sensor " << curNode->
GetName() <<
" not found in digi scheme!" << endl;
216 map<Int_t, set<Int_t>>::iterator mapCh;
219 ((*mapCh).second).clear();
221 ((*mapCh).second).clear();
227 for (
Int_t iChannel = nChannels; iChannel > 0;) {
246 for (
Int_t ifstr = 0; ifstr < nChannels; ifstr++) {
254 new ((*fDigis)[
fNDigis])
CbmStsDigi(0, stationNr, sectorNr, 0, ifstr, digiFSignal, 0);
256 set<Int_t>::iterator it1;
260 if (chPnt.size() == 0) {
265 for (it1 = chPnt.begin(); it1 != chPnt.end(); it1++) {
267 if (it1 == chPnt.begin())
270 match->AddPoint(pnt);
278 for (
Int_t ibstr = 0; ibstr < nChannels; ibstr++) {
284 new ((*fDigis)[
fNDigis])
CbmStsDigi(0, stationNr, sectorNr, 1, ibstr, digiBSignal, 0);
286 set<Int_t>::iterator it1;
290 if (chPnt.size() == 0) {
295 for (it1 = chPnt.begin(); it1 != chPnt.end(); it1++) {
297 if (it1 == chPnt.begin())
300 match->AddPoint(pnt);
311 cout <<
"+ " << flush;
312 cout << setw(15) << left << fName <<
": " << setprecision(4) << setw(8) << fixed << right <<
fTimer.RealTime()
313 <<
" s, digis " << nDigisF <<
" / " << nDigisB << endl;
329 cerr <<
"-E- " << fName <<
"::Exec:: sensor"
330 <<
" not found in digi scheme!" << endl;
338 set<Int_t>::iterator it1;
340 for (it1 = pSet.begin(); it1 != pSet.end(); it1++) {
360 for (
Int_t istep = 0; istep <= nofSteps; istep++) {
418 for (
Int_t istep = 0; istep <= nofSteps; istep++) {
429 for (
Int_t ifstr = 0; ifstr < nofStr; ifstr++) {
430 if (strips[ifstr] == iIChan) {
431 signals[ifstr] += stepEL;
439 strips[nofStr] = iIChan;
440 signals[nofStr] = stepEL;
452 FairRunAna* run = FairRunAna::Instance();
454 Fatal(
"SetParContainers",
"No analysis run");
456 FairRuntimeDb* db = run->GetRuntimeDb();
458 Fatal(
"SetParContainers",
"No runtime database");
473 FairRootManager* ioman = FairRootManager::Instance();
475 Fatal(
"Init",
"No FairRootManager");
480 ioman->Register(
"StsDigi",
"Digital response in STS",
fDigis,
kTRUE);
503 if (fVerbose == 1 || fVerbose == 2)
505 else if (fVerbose > 2)
507 cout <<
"-I- " << fName <<
"::Init: "
508 <<
"STS digitisation scheme succesfully initialised" << endl;
510 <<
", Channels: " <<
fDigiScheme->GetNChannels() << endl;
541 for (
Int_t iStation = 0; iStation < nStations; iStation++) {
544 for (
Int_t iSector = 0; iSector < nSectors; iSector++) {
547 for (
Int_t iSensor = 0; iSensor < nSensors; iSensor++) {
556 for (
Int_t ichan = 2000; ichan > 0;) {
585 cout <<
"============================================================" << endl;
586 cout <<
"===== " << fName <<
": Run summary " << endl;
587 cout <<
"===== " << endl;
588 cout <<
"===== Events processed : " << setw(8) <<
fNEvents << endl;
589 cout.setf(ios_base::fixed, ios_base::floatfield);
590 cout <<
"===== Real time per event : " << setw(8) << setprecision(4) <<
fTime /
fNEvents <<
" s" << endl;
591 cout <<
"===== StsPoints per event : " << setw(8) << setprecision(2) <<
fNPoints /
fNEvents << endl;
592 cout <<
"===== Outside hits per event : " << setw(8) << setprecision(2) <<
fNOutside /
fNEvents <<
" = "
598 cout <<
"============================================================" << endl;
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TRandom * gRandom
Double_t GetXIn() const
Accessors.
CbmStsDigiScheme * fDigiScheme
Digitisation parameter container.
Double_t fEnergyLossToSignal
virtual ~CbmStsRealDigitize()
Destructor.
map< CbmStsSensor *, set< Int_t > > fPointMap
void Reset()
Reset eventwise counters.
virtual InitStatus ReInit()
Reinitialisation.
virtual InitStatus Init()
Intialisation.
CbmStsRealDigitize()
Default constructor.
map< Int_t, set< Int_t > > fBChannelPointsMap
TClonesArray * fDigiMatches
Output array of CbmStsDigi.
CbmStsDigiPar * fDigiPar
Geometry parameter container.
void ProduceHitResponse(CbmStsSensor *sensor)
TClonesArray * fPoints
Digitisation scheme.
virtual void Exec(Option_t *opt)
Execution.
virtual void SetParContainers()
Get parameter containers.
void MakeSets()
Make sensorwise set for points.
virtual void Finish()
Virtual method Finish.
Int_t fNDigis
Output array of CbmStsDigiMatches.
void FindFiredStrips(CbmStsPoint *pnt, Int_t &nofStr, Int_t *&strips, Double_t *&signals, Int_t side)
TClonesArray * fDigis
Input array of CbmStsPoint.
map< Int_t, set< Int_t > > fFChannelPointsMap
Int_t GetSectorNr() const
Int_t GetStationNr() const
Int_t GetDetectorId() const
Int_t GetNChannelsFront() const
CbmStsSensor * GetSensor(Int_t iSensor)
Int_t GetNSensors() const
Float_t GetChannelPlus(Double_t x, Double_t y, Int_t iSide)
Int_t GetFrontChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
Int_t GetBackChannel(Double_t x, Double_t y, Double_t z, Double_t &dPitch)
Int_t GetNSectors() const
CbmStsSector * GetSector(Int_t iSector)
const char * GetName() const override
Double_t Power(Double_t x, Double_t y)
Double_t Sqrt(Double_t x)