L1Trigger
TrackFindingTracklet
src
TrackFitMemory.cc
Go to the documentation of this file.
1
#include "
L1Trigger/TrackFindingTracklet/interface/TrackFitMemory.h
"
2
#include "
L1Trigger/TrackFindingTracklet/interface/SLHCEvent.h
"
3
#include "
L1Trigger/TrackFindingTracklet/interface/Tracklet.h
"
4
#include <iomanip>
5
#include <filesystem>
6
7
using namespace
std
;
8
using namespace
trklet
;
9
10
TrackFitMemory::TrackFitMemory(
string
name
,
Settings
const
& settings,
unsigned
int
iSector,
double
phimin
,
double
phimax
)
11
:
MemoryBase
(
name
, settings, iSector) {
12
phimin_
=
phimin
;
13
phimax_
=
phimax
;
14
}
15
16
void
TrackFitMemory::writeTF
(
bool
first
) {
17
const
string
dirFT =
settings_
.
memPath
() +
"FitTrack/"
;
18
19
std::ostringstream oss;
20
oss << dirFT <<
"TrackFit_"
<<
getName
() <<
"_"
<< std::setfill(
'0'
) << std::setw(2) << (
iSector_
+ 1) <<
".dat"
;
21
auto
const
&
fname
= oss.str();
22
23
if
(
first
) {
24
bx_
= 0;
25
event_
= 1;
26
27
if
(not std::filesystem::exists(dirFT)) {
28
int
fail = system((
string
(
"mkdir -p "
) + dirFT).c_str());
29
if
(fail)
30
throw
cms::Exception
(
"BadDir"
) << __FILE__ <<
" "
<< __LINE__ <<
" could not create directory "
<< dirFT;
31
}
32
out_
.open(
fname
);
33
if
(
out_
.fail())
34
throw
cms::Exception
(
"BadFile"
) << __FILE__ <<
" "
<< __LINE__ <<
" could not create file "
<<
fname
;
35
36
}
else
37
out_
.open(
fname
, std::ofstream::app);
38
39
out_
<<
"BX = "
<< (bitset<3>)
bx_
<<
" Event : "
<<
event_
<< endl;
40
41
for
(
unsigned
int
j
= 0;
j
<
tracks_
.size();
j
++) {
42
out_
<<
"0x"
;
43
out_
<< std::setfill(
'0'
) << std::setw(2);
44
out_
<< hex <<
j
<<
dec
<<
" "
;
45
out_
<<
tracks_
[
j
]->trackfitstr() <<
" "
<<
trklet::hexFormat
(
tracks_
[
j
]->trackfitstr());
46
out_
<<
"\n"
;
47
}
48
out_
.close();
49
50
bx_
++;
51
event_
++;
52
if
(
bx_
> 7)
53
bx_
= 0;
54
}
trklet::MemoryBase::settings_
Settings const & settings_
Definition:
MemoryBase.h:50
trklet::TrackFitMemory::phimax_
double phimax_
Definition:
TrackFitMemory.h:43
phimin
float phimin
Definition:
ReggeGribovPartonMCHadronizer.h:107
trklet::Settings
Definition:
Settings.h:31
trklet::Settings::memPath
std::string const & memPath() const
Definition:
Settings.h:169
trklet::MemoryBase::event_
int event_
Definition:
MemoryBase.h:48
TrackFitMemory.h
trklet::MemoryBase::out_
std::ofstream out_
Definition:
MemoryBase.h:46
trklet::TrackFitMemory::writeTF
void writeTF(bool first)
Definition:
TrackFitMemory.cc:16
trklet::MemoryBase::bx_
int bx_
Definition:
MemoryBase.h:47
trklet::MemoryBase::getName
std::string const & getName() const
Definition:
MemoryBase.h:19
trklet::TrackFitMemory::phimin_
double phimin_
Definition:
TrackFitMemory.h:42
SLHCEvent.h
first
auto first
Definition:
CAHitNtupletGeneratorKernelsImpl.h:112
trklet::MemoryBase
Definition:
MemoryBase.h:13
trklet
Definition:
AllProjectionsMemory.h:9
phimax
float phimax
Definition:
ReggeGribovPartonMCHadronizer.h:106
alignmentValidation.fname
string fname
main script
Definition:
alignmentValidation.py:959
std
Definition:
JetResolutionObject.h:76
trklet::TrackFitMemory::tracks_
std::vector< Tracklet * > tracks_
Definition:
TrackFitMemory.h:44
Exception
Definition:
hltDiff.cc:245
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
trklet::hexFormat
std::string hexFormat(const std::string &binary)
Definition:
Util.h:15
cms::Exception
Definition:
Exception.h:70
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:143
Tracklet.h
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition:
MemoryBase.h:44
Generated for CMSSW Reference Manual by
1.8.16