Commit 5c936f7e authored by Georg Auzinger's avatar Georg Auzinger
Browse files

Added check conditions for finding inputs shorted to ground or with dead testpulse generator,

 fixed the std::stringstream problem.
parent 63b17832
......@@ -6,8 +6,8 @@
<FW_Version NCbcDataSize="4" />
<Module FeId="0" FMCId="0" ModuleId="0" Status="1">
<Global_CBC_Register name="MiscTestPulseCtrl&amp;AnalogMux">0x21</Global_CBC_Register>
<CBC Id="0" configfile="./settings/Cbc_default_electron.txt" />
<CBC Id="1" configfile="./settings/Cbc_default_electron.txt" />
<CBC Id="0" configfile="./settings/Cbc_default_hole.txt" />
<CBC Id="1" configfile="./settings/Cbc_default_hole.txt" />
</Module>
<!-- Commissioning Mode -->
<!-- set to 1 to enable commissioning mode -->
......@@ -52,6 +52,6 @@
<Setting name="TargetOffset">0x50</Setting>
<Setting name="Nevents">100</Setting>
<Setting name="TestPulsePotentiometer">0x00</Setting>
<Setting name="HoleMode">0</Setting>
<Setting name="HoleMode">1</Setting>
<Setting name="VerificationLoop">1</Setting>
</Settings>
......@@ -11,9 +11,14 @@
<Global_CBC_Register name="VCth"> 0x78 </Global_CBC_Register>
<!--Global_CBC_Register name="TriggerLatency"> 0x0C </Global_CBC_Register-->
<CBC_Files path="/settings/" />
<CBC Id="0" configfile="Cbc_default_electron.txt"/>
<CBC Id="1" configfile="Cbc_default_electron.txt"/>
<!-- extra decoupled -->
<!--CBC_Files path="Results/Calibration_Hole_28-10-16_13:34/" /-->
<!-- N06-->
<CBC_Files path="Results/Calibration_Hole_28-10-16_16:12/" />
<CBC Id="0" configfile="FE0CBC0.txt"/>
<CBC Id="1" configfile="FE0CBC1.txt"/>
</Module>
<!-- Commissioning Mode -->
......
......@@ -899,6 +899,10 @@ void HybridTester::FindShorts()
uint8_t cTestPulseGroupId = 0;
std::array<int, 5> cShortedChannelInfo;
std::array<std::vector<std::array<int, 5>>, 8> cShortedGroupsArray;
std::array<int,2> cGroundedChannel;
std::vector<std::array<int,2> > cGroundedChannelsList;
CbcRegReader cReader ( fCbcInterface, "VCth" );
accept ( cReader );
fHistTop->GetYaxis()->SetRangeUser ( 0, fTotalEvents );
......@@ -962,6 +966,12 @@ void HybridTester::FindShorts()
ss << "\t0\t|\t" << cShortedChannelInfo[1] << "\t|\t" << cShortedChannelInfo[2] << "\t|\t" << cShortedChannelInfo[3] << std::endl;
fHistTopMerged->SetBinContent ( cChannelId, fHistTop->GetBinContent ( cChannelId ) );
}
if (fHistTop->GetBinContent( cChannelId ) < 0.5*fTotalEvents && ((cChannelId-1)%127)%8 == cTestPulseGroupId)
{
cGroundedChannel = {0, (cChannelId-1)};
cGroundedChannelsList.push_back(cGroundedChannel);
ss<<"\t0\t|\t"<<(cChannelId-1)<<"\t|\t"<<(cTestPulseGroupId + 0)<<"\t|\tGND"<<std::endl;
}
if ( fHistBottom->GetBinContent ( cChannelId ) > 0.5 * fTotalEvents && ( (cChannelId - 1) % 127) % 8 != cTestPulseGroupId)
{
......@@ -970,19 +980,25 @@ void HybridTester::FindShorts()
ss << "\t1\t|\t" << cShortedChannelInfo[1] << "\t|\t" << cShortedChannelInfo[2] << "\t|\t" << cShortedChannelInfo[3] << std::endl;
fHistBottomMerged->SetBinContent ( cChannelId, fHistBottom->GetBinContent ( cChannelId ) );
}
if (fHistBottom->GetBinContent( cChannelId ) < 0.5*fTotalEvents && ((cChannelId-1)%127)%8 == cTestPulseGroupId)
{
cGroundedChannel = {1, (cChannelId-1)};
cGroundedChannelsList.push_back(cGroundedChannel);
ss<<"\t1\t|\t"<<(cChannelId-1)<<"\t|\t"<<(cTestPulseGroupId + 0)<<"\t|\tGND"<<std::endl;
}
}
cShortedGroupsArray[cTestPulseGroupId] = cShortedChannelsGroup;
//if (cTestPulseGroupId == 2) return;
fHistBottom->Reset();
fHistTop->Reset();
ss << "------------------------------------------------------------------------" << std::endl;
}
}
LOG (INFO) << ss.str();
fHistTopMerged->Scale ( 100 / double_t ( fTotalEvents ) );
fHistTopMerged->GetYaxis()->SetRangeUser ( 0, 100 );
fHistBottomMerged->Scale ( 100 / double_t ( fTotalEvents ) );
......@@ -990,7 +1006,7 @@ void HybridTester::FindShorts()
ReconstructShorts (cShortedGroupsArray);
UpdateHistsMerged();
LOG (INFO) << ss.str();
//LOG (INFO) << ss.str();
}
void HybridTester::Measure()
......
......@@ -311,10 +311,13 @@ void ShortFinder::MergeShorts(ShortsList pShortsListA)
void ShortFinder::FindShorts(std::ostream& os )
{
uint8_t cGroupAddress[8] = {0, 4, 2, 6, 1, 5, 3, 7};
uint8_t cTestPulseGroupId = 0;
int cTestPulseGroupId = 0;
ShortedChannel cShortedChannelInfo;
ShortedChannel cShortedChannelInfo;
ShortedGroupsList cShortedGroupsArray;
Short cGroundedChannel;
ShortsList cGroundedChannelsList;
CbcRegReader cReader( fCbcInterface, "VCth" );
accept( cReader );
......@@ -371,6 +374,12 @@ void ShortFinder::FindShorts(std::ostream& os )
cShortedChannelsGroup.push_back(cShortedChannelInfo);
os<<"\t0\t|\t"<<cShortedChannelInfo[1]<<"\t|\t"<<cShortedChannelInfo[2]<<"\t|\t"<<cShortedChannelInfo[3]<<std::endl;
}
else if (fHistTop->GetBinContent( cChannelId ) < 0.5*fTotalEvents && ((cChannelId-1)%127)%8 == cTestPulseGroupId)
{
cGroundedChannel = {0, (cChannelId-1)};
cGroundedChannelsList.push_back(cGroundedChannel);
os<<"\t0\t|\t"<<(cChannelId-1)<<"\t|\t"<<(cTestPulseGroupId)<<"\t|\tGND"<<std::endl;
}
if ( fHistBottom->GetBinContent( cChannelId ) > 0.5*fTotalEvents && ((cChannelId-1)%127)%8 != cTestPulseGroupId)
{
......@@ -378,9 +387,11 @@ void ShortFinder::FindShorts(std::ostream& os )
cShortedChannelsGroup.push_back(cShortedChannelInfo);
os<<"\t1\t|\t"<<cShortedChannelInfo[1]<<"\t|\t"<<cShortedChannelInfo[2]<<"\t|\t"<<cShortedChannelInfo[3]<<std::endl;
}
else
else if (fHistBottom->GetBinContent( cChannelId ) < 0.5*fTotalEvents && ((cChannelId-1)%127)%8 == cTestPulseGroupId)
{
cGroundedChannel = {1, (cChannelId-1)};
cGroundedChannelsList.push_back(cGroundedChannel);
os<<"\t1\t|\t"<<(cChannelId-1)<<"\t|\t"<<(cTestPulseGroupId)<<"\t|\tGND"<<std::endl;
}
}
......
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