Skip to content

Commit e8de2a4

Browse files
authored
Merge pull request #1888 from ehrlich-uva/CrvCalibration
Updated CRV channel map
2 parents dde444e + 7011579 commit e8de2a4

11 files changed

Lines changed: 5331 additions & 471 deletions

CRVConditions/data/calib_extracted_20260716.txt

Lines changed: 4612 additions & 0 deletions
Large diffs are not rendered by default.

CRVConditions/data/extracted_v04.txt

Lines changed: 192 additions & 192 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
TABLE CRVBadChan
2+
#A channel can have more than one status bit. Add all status bits for the complete status.
3+
#status 1 (bit 0): not connected
4+
#status 2 (bit 1): ignore channel in reconstruction
5+
#status 4 (bit 2): no data
6+
#status 8 (bit 3): no pedestal
7+
#status 16 (bit 4): no calibration constant
8+
#status 32 (bit 5): noisy
9+
#channel,status
10+
281,3
11+
296,3
12+
518,3
13+
520,3
14+
863,3
15+
1107,3
16+
1587,3
17+
2246,3

CRVReco/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ cet_build_plugin(CrvWidebandTriggerFilter art::module
8686
Offline::RecoDataProducts
8787
)
8888

89-
cet_build_plugin(CrvTimingStudies art::module
90-
REG_SOURCE src/CrvTimingStudies_module.cc
89+
cet_build_plugin(CrvTimeOffsets art::module
90+
REG_SOURCE src/CrvTimeOffsets_module.cc
9191
LIBRARIES REG
9292
art_root_io::TFileService_service
9393
Offline::CRVReco

CRVReco/src/CrvCalibration_module.cc

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ namespace mu2e
8787
ProditionsHandle<CRVCalib> _calib_h;
8888

8989
std::vector<double> _pedestals;
90-
std::vector<double> _timeOffsets;
9190
};
9291

9392

@@ -122,7 +121,6 @@ namespace mu2e
122121
_calibHistsPulseArea.reserve(counters.size()*CRVId::nChanPerBar);
123122
_calibHistsPulseHeight.reserve(counters.size()*CRVId::nChanPerBar);
124123
_pedestals.resize(counters.size()*CRVId::nChanPerBar);
125-
_timeOffsets.resize(counters.size()*CRVId::nChanPerBar);
126124

127125
art::ServiceHandle<art::TFileService> tfs;
128126
for(size_t barIndex=0; barIndex<counters.size(); ++barIndex)
@@ -138,7 +136,6 @@ namespace mu2e
138136
Form("crvCalibrationHistPulseHeight_%lu",channelIndex),
139137
_histBinsPulseHeight,0,_histMaxPulseHeight));
140138
_pedestals[channelIndex]=0;
141-
_timeOffsets[channelIndex]=0;
142139
}
143140
}
144141
}
@@ -180,23 +177,6 @@ namespace mu2e
180177
treePedestal->Fill(); //fill tree
181178
}
182179

183-
outputFile<<std::endl;
184-
185-
//time offsets
186-
TTree *treeTimeOffset = tfs->make<TTree>("crvTimeOffsets","crvTimeOffsets");
187-
double offset;
188-
treeTimeOffset->Branch("channel", &channel);
189-
treeTimeOffset->Branch("timeOffset", &offset);
190-
191-
outputFile<<"TABLE CRVTime"<<std::endl;
192-
outputFile<<"#channel,timeOffset"<<std::endl;
193-
for(channel=0; channel<_timeOffsets.size(); ++channel)
194-
{
195-
offset=_timeOffsets.at(channel);
196-
outputFile<<channel<<","<<offset<<std::endl; //write to DB text file
197-
treeTimeOffset->Fill(); //fill tree
198-
}
199-
200180
outputFile.close();
201181
}
202182

@@ -215,7 +195,6 @@ namespace mu2e
215195
for(size_t channelIndex=0; channelIndex<_pedestals.size(); ++channelIndex)
216196
{
217197
_pedestals[channelIndex] = calib.pedestal(channelIndex);
218-
_timeOffsets[channelIndex] = calib.timeOffset(channelIndex);
219198
}
220199
}
221200

CRVReco/src/CrvPedestalFinder_module.cc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include <TH1F.h>
2828
#include <TF1.h>
29-
#include <TTree.h>
3029

3130
namespace mu2e
3231
{
@@ -64,10 +63,6 @@ namespace mu2e
6463
double _maxADCspread;
6564
std::string _tmpDBfileName;
6665
std::vector<TH1F*> _pedestalHists;
67-
68-
ProditionsHandle<CRVCalib> _calib_h;
69-
70-
std::vector<double> _timeOffsets;
7166
};
7267

7368

@@ -91,7 +86,6 @@ namespace mu2e
9186
GeomHandle<CosmicRayShield> CRS;
9287
const std::vector<std::shared_ptr<CRSScintillatorBar> > &counters = CRS->getAllCRSScintillatorBars();
9388
_pedestalHists.reserve(counters.size()*CRVId::nChanPerBar);
94-
_timeOffsets.resize(counters.size()*CRVId::nChanPerBar);
9589

9690
art::ServiceHandle<art::TFileService> tfs;
9791
for(size_t barIndex=0; barIndex<counters.size(); ++barIndex)
@@ -103,7 +97,6 @@ namespace mu2e
10397
_pedestalHists.emplace_back(tfs->make<TH1F>(Form("crvPedestalHist_%lu",channelIndex),
10498
Form("crvPedestalHist_%lu",channelIndex),
10599
_histBins,_histMin,_histMax));
106-
_timeOffsets[channelIndex]=0;
107100
}
108101
}
109102
}
@@ -144,25 +137,6 @@ namespace mu2e
144137
outputFile<<channel<<","<<funcPedestal.GetParameter(1)<<",-1,-1"<<std::endl; //only print out pedestal values
145138
}
146139

147-
outputFile<<std::endl;
148-
149-
//time offsets
150-
art::ServiceHandle<art::TFileService> tfs;
151-
TTree *treeTimeOffsets = tfs->make<TTree>("crvTimeOffsets","crvTimeOffsets");
152-
size_t channel;
153-
double offset;
154-
treeTimeOffsets->Branch("channel", &channel);
155-
treeTimeOffsets->Branch("timeOffset", &offset);
156-
157-
outputFile<<"TABLE CRVTime"<<std::endl;
158-
outputFile<<"#channel, timeOffset"<<std::endl;
159-
for(channel=0; channel<_timeOffsets.size(); ++channel)
160-
{
161-
offset=_timeOffsets.at(channel);
162-
outputFile<<channel<<","<<offset<<std::endl; //write to temporary DB text file
163-
treeTimeOffsets->Fill(); //fill tree
164-
}
165-
166140
outputFile.close();
167141
}
168142

@@ -171,19 +145,6 @@ namespace mu2e
171145
art::Handle<CrvDigiCollection> crvDigiCollection;
172146
if(!event.getByLabel(_crvDigiModuleLabel,(_useNZS?"NZS":""),crvDigiCollection)) return;
173147

174-
//find time offsets from first event
175-
//need to assume that this is only used for calibration runs where the time offsets stay constant over the entire run
176-
static bool first=true;
177-
if(first)
178-
{
179-
first=false;
180-
auto const& calib = _calib_h.get(event.id());
181-
for(size_t channelIndex=0; channelIndex<_timeOffsets.size(); ++channelIndex)
182-
{
183-
_timeOffsets[channelIndex] = calib.timeOffset(channelIndex);
184-
}
185-
}
186-
187148
for(auto iter=crvDigiCollection->begin(); iter!=crvDigiCollection->end(); ++iter)
188149
{
189150
int barIndex = iter->GetScintillatorBarIndex().asInt();

0 commit comments

Comments
 (0)