Commit e86082e3 authored by Fabio Ravera's avatar Fabio Ravera
Browse files

Merge branch 'ps_module_dev' into 'Dev'

Minor bug fix in offset tuning

See merge request cms_tk_ph2/Ph2_ACF!288
parents 25fef38b badc2d44
......@@ -34,22 +34,22 @@
<SSA_Files path="${PH2ACF_BASE_DIR}/settings/SSAFiles/" />
<SSA Id="0" configfile="SSA.txt" />
<!--<SSA Id="1" configfile="SSA.txt" />
<SSA Id="1" configfile="SSA.txt" />
<SSA Id="2" configfile="SSA.txt" />
<SSA Id="4" configfile="SSA.txt" />
<SSA Id="5" configfile="SSA.txt" />
<SSA Id="6" configfile="SSA.txt" />
<SSA Id="7" configfile="SSA.txt" /> -->
<SSA Id="7" configfile="SSA.txt" />
<MPA_Files path="${PH2ACF_BASE_DIR}/settings/MPAFiles/" />
<MPA Id="8" configfile="MPA.txt" />
<!--<MPA Id="9" configfile="MPA.txt" />
<MPA Id="9" configfile="MPA.txt" />
<MPA Id="10" configfile="MPA.txt" />
<MPA Id="11" configfile="MPA.txt" />
<MPA Id="12" configfile="MPA.txt" />
<MPA Id="13" configfile="MPA.txt" />
<MPA Id="14" configfile="MPA.txt" />
<MPA Id="15" configfile="MPA.txt" />-->
<MPA Id="15" configfile="MPA.txt" />
<CIC_Files path="${PH2ACF_BASE_DIR}/settings/CicFiles/" />
<CIC Id="8" configfile="CIC_default.txt" />
......@@ -71,27 +71,27 @@
<SamplingDelay stripCoarse="1" stripFine="0" pixelCoarse="2" pixelFine="0"/>
<InjectedCharge stripCharge="0" pixelCharge="0"/>
<CIC enableBend="1" enableLastLine="1" enableSparsification="1" clockFrequency="320" driveStrength="3" edgeSelect="1"/>
<MaskedStrips SSAId="4" Rows="58,59" />
<MaskedStrips SSAId="4" Rows="58,59" />
</Global>
<SSA_Files path="${PH2ACF_BASE_DIR}/settings/SSAFiles/" />
<SSA Id="0" configfile="SSA.txt" />
<!--<SSA Id="1" configfile="SSA.txt" />
<SSA Id="1" configfile="SSA.txt" />
<SSA Id="2" configfile="SSA.txt" />
<SSA Id="4" configfile="SSA.txt" />
<SSA Id="5" configfile="SSA.txt" />
<SSA Id="6" configfile="SSA.txt" />
<SSA Id="7" configfile="SSA.txt" /> -->
<SSA Id="7" configfile="SSA.txt" />
<MPA_Files path="${PH2ACF_BASE_DIR}/settings/MPAFiles/" />
<MPA Id="8" configfile="MPA.txt" />
<!--<MPA Id="9" configfile="MPA.txt" />
<MPA Id="9" configfile="MPA.txt" />
<MPA Id="10" configfile="MPA.txt" />
<MPA Id="11" configfile="MPA.txt" />
<MPA Id="12" configfile="MPA.txt" />
<MPA Id="13" configfile="MPA.txt" />
<MPA Id="14" configfile="MPA.txt" />
<MPA Id="15" configfile="MPA.txt" />-->
<MPA Id="15" configfile="MPA.txt" />
<CIC_Files path="${PH2ACF_BASE_DIR}/settings/CicFiles/" />
<CIC Id="8" configfile="CIC_default.txt" />
......@@ -259,7 +259,7 @@
<Setting name="SaveRawData">1</Setting>
<!--PedestalEqualization-->
<Setting name="Nevents">100</Setting>
<Setting name="Nevents">2500</Setting>
<Setting name="HoleMode">0</Setting>
<Setting name="VerificationLoop">1</Setting>
<Setting name="MaskChannelsFromOtherGroups">0</Setting>
......
......@@ -92,7 +92,6 @@ void PedestalEqualization::Initialise(bool pAllChan, bool pDisableStubLogic)
fTargetOffset = findValueInSettings<double>("PedestalEqualizationTargetOffset", cDefTargetOffset);
// uint8_t cEnableFastCounterReadout = (uint8_t)findValueInSettings<double>("EnableFastCounterReadout", 0);
// uint8_t cEnablePairSelect = (uint8_t)findValueInSettings<double>("EnablePairSelect", 0);
if(fWithSSA or fWithMPA) fTargetOffset = 0xF;
LOG(INFO) << BOLDBLUE << "PedestalEqualization::Initialise Occupancy at pedestal is " << fOccupancyAtPedestal << " target offset is " << +fTargetOffset << RESET;
this->SetSkipMaskedChannels(fSkipMaskedChannels);
......@@ -183,7 +182,7 @@ void PedestalEqualization::Initialise(bool pAllChan, bool pDisableStubLogic)
LOG(INFO) << " Nevents = " << fEventsPerPoint;
LOG(INFO) << " TestPulseAmplitude = " << int(fTestPulseAmplitude);
LOG(INFO) << " Target Vcth determined algorithmically for Chip";
LOG(INFO) << " Target Offset fixed to half range (0x80) for Chip";
LOG(INFO) << " Target Offset = 0x" << std::hex << +fTargetOffset;
}
void PedestalEqualization::Reset()
{
......@@ -304,7 +303,7 @@ void PedestalEqualization::FindVplus()
ContainerFactory::copyAndInitChip<uint16_t>(*fDetectorContainer, theVcthContainer);
float cMeanStripsValue = 0., cMeanPixelsValue = 0.;
uint8_t cNStripChips = 0, cNPixelChips = 0;
float cNStripChips = 0., cNPixelChips = 0.;
for(auto board: theVcthContainer) // for on boards - begin
{
for(auto opticalGroup: *board) // for on opticalGroup - begin
......@@ -325,11 +324,12 @@ void PedestalEqualization::FindVplus()
<< " = " << tmpVthr << RESET;
uint32_t ENCHAN = theChip->getChipOriginalMask()->getNumberOfEnabledChannels();
uint32_t TOTCHAN = chip->size();
// LOG(INFO) << GREEN << "NCHANNELS " << ENCHAN << " TOTCHAN " << TOTCHAN << RESET;
LOG(DEBUG) << GREEN << "NCHANNELS " << ENCHAN << " TOTCHAN " << TOTCHAN << RESET;
if(cType == FrontEndType::SSA || cType == FrontEndType::CBC3)
{
cNStripChips += float(ENCHAN) / float(TOTCHAN);
cMeanStripsValue += tmpVthr * (float(ENCHAN) / float(TOTCHAN));
LOG(DEBUG) << "MeanStripsValue : " << +cMeanStripsValue << " -- NStripChips : " << +cNStripChips << RESET;
}
else if(cType == FrontEndType::MPA)
{
......
Supports Markdown
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