<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">George Iakovidis</strong> <span dir="auto"><<a href="mailto:george.iakovidis@cern.ch">george.iakovidis@cern.ch</a>></span><br>Date: Wed, Apr 15, 2020 at 9:54 AM<br>Subject: [EXTERNAL] Re: Modeling of VMM3<br>To: Alexandre Camsonne <<a href="mailto:camsonne@jlab.org">camsonne@jlab.org</a>><br>Cc: <a href="mailto:degeronimo@ieee.org">degeronimo@ieee.org</a> <<a href="mailto:degeronimo@ieee.org">degeronimo@ieee.org</a>>, <a href="mailto:kg6cq@virginia.edu">kg6cq@virginia.edu</a> <<a href="mailto:kg6cq@virginia.edu">kg6cq@virginia.edu</a>><br></div><br><br>
<div>
<div style="word-wrap:break-word;line-break:after-white-space">Hi Alexandre
<div><br>
</div>
<div>I have done several digitization models for ATLAS. I have solved the shaper and written it attaching the code and a document. </div>
<div>there is a lot of it inside ATLAS but I cannot just extract it. Data output simulation I don’t quite understand what you aim, it’s </div>
<div>quite simple, you get 38 bits in continuous mode and another specific data format on L0 mode which is documented in the </div>
<div>docs I gave you</div>
<div><br>
</div>
<div>Cheers</div>
<div><span style="white-space:pre-wrap"></span>George</div>
<div><br>
<div></div>
</div>
</div>
<div style="word-wrap:break-word;line-break:after-white-space">
<div>
<div></div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> vmmResponse(vector<<span style="color:rgb(187,44,162)">double</span>> electronsTime, vector<<span style="color:rgb(187,44,162)">double</span>> electronsGain, <span style="color:rgb(187,44,162)">double</span> &slope, <span style="color:rgb(187,44,162)">double</span> electronicsThreshold, <span style="color:rgb(187,44,162)">double</span> &litudeFirstPeak){</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
TH1D *response = new TH1D(<span style="color:rgb(209,47,27)">"response"</span>,<span style="color:rgb(209,47,27)">"VMM response"</span>,<span style="color:rgb(39,42,216)">5000</span>,<span style="color:rgb(39,42,216)">0</span>,<span style="color:rgb(39,42,216)">500</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
response->Reset();</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> PeakingTime = <span style="color:rgb(39,42,216)">25.</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> thresh = <span style="color:rgb(39,42,216)">0.05</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> a = (PeakingTime*(<span style="color:rgb(39,42,216)">10</span>^-<span style="color:rgb(39,42,216)">9</span>))/<span style="color:rgb(39,42,216)">1.5</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> pole0 = <span style="color:rgb(39,42,216)">1.263</span>/a; <span style="color:rgb(0,132,0)">// real pole</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> Re_pole1 = <span style="color:rgb(39,42,216)">1.149</span>/a;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> Im_pole1 = -<span style="color:rgb(39,42,216)">0.786</span>/a; <span style="color:rgb(0,132,0)">//complex pole</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> K0 = <span style="color:rgb(39,42,216)">1.584</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> Re_K1 = -<span style="color:rgb(39,42,216)">0.792</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> Im_K1 = -<span style="color:rgb(39,42,216)">0.115</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> pole1_square = Re_pole1*Re_pole1 + Im_pole1*Im_pole1;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> K1_abs = TMath::Sqrt(Re_K1*Re_K1 + Im_K1*Im_K1);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> argK1 = TMath::ATan2(Im_K1, Re_K1);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">if</span>(debugElx)</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)">
<span style="color:rgb(0,0,0)"> cout<<</span>"#################### Starting VMM responce with size of electrons: "<span style="color:rgb(0,0,0)"><<electronsTime.size()<<</span>" ####################"<span style="color:rgb(0,0,0)"><<endl;</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> t,st,timeStep;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
timeStep=<span style="color:rgb(39,42,216)">0.1</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">for</span> (Int_t i=<span style="color:rgb(39,42,216)">0</span>; i<electronsTime.size(); i++) {</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">if</span>(debugElx)</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
cout<<<span style="color:rgb(209,47,27)">"# electrons with time: "</span><<electronsTime[i]<<<span style="color:rgb(209,47,27)">", and gain: "</span><<electronsGain[i]<<endl;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">for</span>(<span style="color:rgb(187,44,162)">double</span> ti=electronsTime[i];ti<=<span style="color:rgb(39,42,216)">500</span>;ti=ti+timeStep){</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
t = (ti-electronsTime[i])*(<span style="color:rgb(39,42,216)">10</span>^-<span style="color:rgb(39,42,216)">9</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
st = electronsGain[i]* TMath::Power(a,<span style="color:rgb(39,42,216)">3</span>)*pole0*pole1_square*((K0*TMath::Exp(-t*pole0))+(<span style="color:rgb(39,42,216)">2.</span>*K1_abs*TMath::Exp(-t*Re_pole1)*cos(-t*Im_pole1+argK1)));</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
response->Fill(ti,st);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
}</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
}</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> timeAboveThr = response->GetXaxis()->GetBinCenter(response->FindFirstBinAbove(electronicsThreshold));</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
TF1 *polFit = new TF1(<span style="color:rgb(209,47,27)">"polFit"</span>,<span style="color:rgb(209,47,27)">"pol1"</span>,<span style="color:rgb(39,42,216)">0</span>,<span style="color:rgb(39,42,216)">500</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
polFit->SetLineColor(kRed);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
response->Fit(<span style="color:rgb(209,47,27)">"polFit"</span>,<span style="color:rgb(209,47,27)">"QR"</span>,<span style="color:rgb(209,47,27)">""</span>,timeAboveThr,timeAboveThr+<span style="color:rgb(39,42,216)">2.</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
slope = polFit->GetParameter(<span style="color:rgb(39,42,216)">1</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">if</span>(debug)</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
cout<<<span style="color:rgb(209,47,27)">" Threshold found: "</span><< timeAboveThr <<endl;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)">
<span style="color:rgb(0,0,0)"> </span>// peak finder</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
TSpectrum *s = new TSpectrum(<span style="color:rgb(39,42,216)">10</span>,<span style="color:rgb(39,42,216)">1</span>); <span style="color:rgb(0,132,0)">//Spectrum for the peaks detection</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">double</span> tFromFirstPeak = <span style="color:rgb(39,42,216)">50000</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
Int_t nfound = s->Search(response,<span style="color:rgb(39,42,216)">1</span>,<span style="color:rgb(209,47,27)">"nobackground,goff"</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
Float_t *xpeaks = s->GetPositionX();</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">for</span>(<span style="color:rgb(187,44,162)">int</span> j = <span style="color:rgb(39,42,216)">0</span>;j<nfound;j++){</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">if</span>(response->GetBinContent(response->FindBin(xpeaks[j]))<electronicsThreshold){</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">continue</span>;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
}</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">if</span>(tFromFirstPeak>xpeaks[j])</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
tFromFirstPeak = xpeaks[j];</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
}</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">int</span> binFromFirstPeak = response->FindBin(tFromFirstPeak);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
amplitudeFirstPeak = response->GetBinContent(binFromFirstPeak);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">if</span>(debugElx){</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
TCanvas *responseCanvas = new TCanvas(<span style="color:rgb(209,47,27)">"responseCanvas"</span>,<span style="color:rgb(209,47,27)">"Response"</span>,<span style="color:rgb(39,42,216)">600</span>,<span style="color:rgb(39,42,216)">600</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
responseCanvas->cd();</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
response->Draw(<span style="color:rgb(209,47,27)">"C"</span>);</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)">
<span style="color:rgb(0,0,0)"> cout<<</span>"Plotting histogram with first peak:"<span style="color:rgb(0,0,0)"><<tFromFirstPeak<<</span>", slope: "<span style="color:rgb(0,0,0)"><<slope <<</span>", amplitude at first peak:
"<span style="color:rgb(0,0,0)"><<amplitudeFirstPeak<<</span>", Hit enter"<span style="color:rgb(0,0,0)"><<endl;</span></div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
responseCanvas->Update();</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
getchar();</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
delete responseCanvas;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
}</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
delete response,polFit;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<span style="color:rgb(187,44,162)">return</span> timeAboveThr;</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
}</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<br>
</div>
<div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
<br>
</div>
<blockquote type="cite">
<div>On 14 Apr 2020, at 17:09, Alexandre Camsonne <<a href="mailto:camsonne@jlab.org" target="_blank">camsonne@jlab.org</a>> wrote:</div>
<br>
<div>
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>we would like to simulate the performance of the chip in our high background environment.</div>
<div><br>
</div>
<div>Do you have any code to simulate the shape of the signals and simulate the data extracted by the chip ? Most likely this was done for the ATLAS NSW simulation/</div>
<div><br>
</div>
<div>Thank you,</div>
<div><br>
</div>
<div>Alexandre<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div></div>