Changeset 251 in Idarraga
- Timestamp:
- Nov 16, 2011, 4:42:27 PM (13 years ago)
- Location:
- mafalda
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
mafalda/AnalysisCore/MediPixAnalysisCore.h
r222 r251 273 273 274 274 fChain->SetBranchAddress("m_frameXC", &m_frameXC, &b_FramesData_m_frameXC); 275 //fChain->SetBranchAddress("m_lvl1", &m_lvl1, &b_FramesData_m_lvl1);275 fChain->SetBranchAddress("m_lvl1", &m_lvl1, &b_FramesData_m_lvl1); 276 276 fChain->SetBranchAddress("m_nEntriesPad", &m_nEntriesPad, &b_FramesData_m_nEntriesPad); 277 277 fChain->SetBranchAddress("m_nHitsInPad", &m_nHitsInPad, &b_FramesData_m_nHitsInPad); -
mafalda/BlobsFinder/BlobsFinder.cpp
r222 r251 598 598 Float_t balanceToMin = 0., balanceToMax = 0., 599 599 slopeGuess = 0., intersectionyGuess = 0., 600 chisquare_OverDof = 0. ;600 chisquare_OverDof = 0., chisquare = 0., ndf = 0.; 601 601 Int_t minQId = 0, maxQId = 0; 602 602 GetBalance(min_x, max_x, min_y, max_y, … … 612 612 Float_t fitCut = 0.; 613 613 614 MAFTools::LinearRegression(&fitSlope, &fitCut, &chisquare_OverDof 615 ,slopeGuess, intersectionyGuess616 ,oneBlob.GetContentSet());614 MAFTools::LinearRegression(&fitSlope, &fitCut, &chisquare_OverDof, &chisquare, &ndf, 615 slopeGuess, intersectionyGuess, 616 oneBlob.GetContentSet()); 617 617 618 618 oneBlob.bP.chisquare_OverDof = chisquare_OverDof; 619 oneBlob.bP.chisquare = chisquare; 620 oneBlob.bP.NDF = ndf; 619 621 oneBlob.bP.rotAngle = -1.*TMath::ATan(fitSlope); 620 622 oneBlob.bP.fitSlope = fitSlope; -
mafalda/BlobsFinder/BlobsFinder.h
r222 r251 88 88 Float_t rotAngle; 89 89 Float_t chisquare_OverDof; 90 Float_t chisquare; 91 Float_t NDF; 90 92 Float_t fitSlope; 91 93 Float_t fitCut; -
mafalda/MAFTools/MAFTools.cpp
r247 r251 29 29 30 30 Bool_t LinearRegression(Float_t * slope, Float_t * cut, 31 Float_t * chisquare_OverDof, 31 Float_t * chisquare_OverDof, Float_t * chisquare, Float_t * ndf, 32 32 Float_t initslope, Float_t initycross, 33 33 set< pair<Int_t, Int_t> > blobContent){ … … 66 66 67 67 *chisquare_OverDof = f1->GetChisquare()/(Float_t)f1->GetNDF(); 68 *chisquare = f1->GetChisquare(); 69 *ndf = (Float_t)f1->GetNDF(); 68 70 *slope = f1->GetParameter(0); 69 71 *cut = f1->GetParameter(1); -
mafalda/MAFTools/MAFTools.h
r247 r251 24 24 25 25 Bool_t LinearRegression(Float_t * slope, Float_t * cut, 26 Float_t * chisquare_OverDof, 26 Float_t * chisquare_OverDof, Float_t * chisquare, Float_t * ndf, 27 27 Float_t initslope, Float_t initycross, 28 28 std::set< std::pair<Int_t, Int_t> > blobContent); -
mafalda/MPXAlgo/MediPixAlgo.cpp
r240 r251 439 439 //}; 440 440 441 // In the future I should write an error handler --> TODO 442 void MediPixAlgo::__FATALMC_ERROR(){ 443 cout << "[FATAL] Request of MC related information on real data ... giving up" << endl; 444 exit(1); 445 } 446 441 447 Int_t MediPixAlgo::GetPrimaryMCVertex_N(){ 448 if( !IsMCData() ) { __FATALMC_ERROR(); } 442 449 return m_myManager->GetPrimaryMCVertex_N(); 443 450 } 444 451 Double_t MediPixAlgo::GetPrimaryMCVertex_X(int i){ 452 if( !IsMCData() ) { __FATALMC_ERROR(); } 445 453 return m_myManager->GetPrimaryMCVertex_X(i); 446 454 } 447 455 Double_t MediPixAlgo::GetPrimaryMCVertex_Y(int i){ 456 if( !IsMCData() ) { __FATALMC_ERROR(); } 448 457 return m_myManager->GetPrimaryMCVertex_Y(i); 449 458 } 450 459 Double_t MediPixAlgo::GetPrimaryMCVertex_Z(int i){ 460 if( !IsMCData() ) { __FATALMC_ERROR(); } 451 461 return m_myManager->GetPrimaryMCVertex_Z(i); 452 462 } -
mafalda/MPXAlgo/MediPixAlgo.h
r240 r251 128 128 Double_t GetPrimaryMCVertex_Z(int); 129 129 130 // error handling --> TODO 131 void __FATALMC_ERROR(); 132 130 133 /* ****************************************** */ 131 134 -
mafalda/OctoCEA/OctoCEA.cpp
r248 r251 11 11 #include "MAFTools.h" 12 12 13 #include <map> 14 #include <vector> 15 13 16 using namespace MSG; 14 17 … … 19 22 m_joinSlopeAngleTolerance = 5; // deg 20 23 m_joinCutPixelTolerance = 20; // pixels 24 m_minNPixels = 5; 25 m_minNPixelsClouds = 300; 21 26 } 22 27 … … 27 32 // This value will be overridden by the configuration since it'll be set up 28 33 // a few lines below as a configuration value 29 m_minNPixels = 5;30 34 31 35 // You will get an ntuple file containing a TTree with the name of this … … 36 40 getMyTree()->Branch("alphaAngle", &m_alphaAngle); 37 41 getMyTree()->Branch("chi2", &m_chi2); 42 getMyTree()->Branch("chi2Prob", &m_chi2Prob); 43 getMyTree()->Branch("typeOfRecoFrame",&m_typeOfRecoFrame); 44 45 getMyTree()->Branch("assemblyTime", &m_assemblyTime); 46 getMyTree()->Branch("frameId", &m_frameId); 38 47 39 48 // A configuration value that can be tuned from the Viewer 40 49 RegisterConfigurationValue(&m_minNPixels, "minNPixels"); 50 RegisterConfigurationValue(&m_minNPixelsClouds, "minNPixelsClouds"); 41 51 RegisterConfigurationValue(&m_minClusterSize, "minClusterSize"); 42 52 RegisterConfigurationValue(&m_joinSlopeAngleTolerance, "joinSlopeAngleTolerance"); … … 46 56 47 57 void OctoCEA::Execute(){ 58 59 m_frameId = GetFrameId(); 60 m_typeOfRecoFrame = __RECO_UNDEFINED; 48 61 49 62 // Ask the store gate if the previous algorithm (BlobsFinder --> reponsible for clustering) … … 65 78 vector<Float_t> slopesV; 66 79 vector<Float_t> cutsV; 67 80 vector<Int_t> blobIndexV; 81 82 int blobIndex = -1; 68 83 for( ; blobsItr != blobsVector.end() ; blobsItr++) 69 84 { 85 blobIndex++; 70 86 71 87 // Limit all this to clusters with a minimum size. … … 78 94 if ( (*blobsItr).GetBlobType() >= _MIP ) { 79 95 80 vector< pair< Int_t, Int_t> > limitPixels = MAFTools::FindLimitPixels(*blobsItr);96 vector< pair<Float_t, Float_t> > limitPixels = MAFTools::FindLimitPixels(*blobsItr); 81 97 82 98 float cut = (*blobsItr).bP.fitCut; … … 86 102 slopesV.push_back(slope); 87 103 cutsV.push_back(cut); 88 89 float cx = (*blobsItr).bP.geoCenter_x; 90 float hwidthx = (*blobsItr).bP.width_x/10.; 91 float alpha = (*blobsItr).bP.rotAngle; 104 blobIndexV.push_back(blobIndex); 105 106 //float cx = (*blobsItr).bP.geoCenter_x; 107 //float hwidthx = (*blobsItr).bP.width_x/10.; 108 //float alpha = (*blobsItr).bP.rotAngle; 92 109 93 110 //alpha = fabs(alpha); … … 108 125 109 126 110 m_clusterSize.push_back( (*blobsItr).bP.nPixels ); 111 m_alphaAngle.push_back( alpha*180./TMath::Pi() ); 112 m_chi2.push_back( (*blobsItr).bP.chisquare_OverDof ); 113 114 115 } 116 117 } 118 127 128 129 130 } 131 132 } 133 134 135 // Map index of the segment with index in the blobs container 136 map<int, int> matchAssemblyIndexesMap; 119 137 120 138 // Study a possible mip assembly … … 125 143 vector<Float_t>::iterator itrS = slopesV.begin(); 126 144 vector<Float_t>::iterator itrC = cutsV.begin(); 127 128 Float_t firstS = *itrS; 129 Float_t firstC = *itrC; 130 Log << MSG::INFO << " leading --> cut : " << firstC << " | slope : " << firstS << endreq; 131 132 itrS++; itrC++; // compare starting from the second 145 vector<int>::iterator itrIndex = blobIndexV.begin(); 146 vector<int>::iterator itrIndex2 = blobIndexV.begin(); 147 148 Log << MSG::INFO << "List of fragments " << endreq; 149 int cntr = 0; 133 150 for ( ; itrS != slopesV.end() ; ) { 134 135 Log << MSG::INFO << " cut : " << *itrC << " | slope : " << *itrS << endreq; 136 137 if( firstC <= (*itrC) - m_joinCutPixelTolerance && 138 firstC >= (*itrC) - m_joinCutPixelTolerance ) { 139 Log << MSG::INFO << " within tolerance " << endreq; 140 } 141 151 Log << MSG::INFO << "[" << cntr << "] " << "cut : " << *itrC << " | slope : " << *itrS; 152 Log << MSG::INFO << " | container index : " << *itrIndex2 << endreq; 142 153 itrS++; 143 154 itrC++; 144 } 145 155 cntr++; 156 itrIndex2++; 157 } 158 159 // Search of a trend. Rewind iterators. 160 vector<Float_t>::iterator itrC2 = cutsV.begin(); 161 cntr = 0; 162 itrIndex2 = blobIndexV.begin(); 163 int cntr2 = 0, matchesCntr = 0; 164 for (itrC = cutsV.begin() ; itrC != cutsV.end() ; itrC++) { 165 cntr2=0; 166 itrIndex2 = blobIndexV.begin(); 167 for (itrC2 = cutsV.begin() ; itrC2 != cutsV.end() ; itrC2++) { 168 if(itrC == itrC2) {cntr2++; itrIndex2++; continue;} // don't compare same element 169 Log << MSG::INFO << "[" << cntr << "] --> " << "[" << cntr2 << "] "; 170 if ( (*itrC2) >= (*itrC) - m_joinCutPixelTolerance && 171 (*itrC2) <= (*itrC) + m_joinCutPixelTolerance ) { 172 Log << MSG::INFO << " within tolerance "; 173 matchesCntr++; 174 matchAssemblyIndexesMap[cntr] = (*itrIndex); 175 matchAssemblyIndexesMap[cntr2] = (*itrIndex2); 176 } 177 Log << MSG::INFO << endreq; 178 cntr2++; 179 itrIndex2++; 180 } 181 if (matchesCntr > 1) break; 182 matchesCntr = 0; // otherwise rewind 183 cntr++; 184 itrIndex++; 185 Log << MSG::INFO << "--------------------" << endreq; 186 } 187 188 if(matchesCntr > 1) { 189 Log << MSG::INFO << "Found mip assembly" << endreq; 190 map<int, int>::iterator mItr = matchAssemblyIndexesMap.begin(); 191 for ( ; mItr != matchAssemblyIndexesMap.end() ; mItr++) { 192 Log << MSG::INFO << "[" << (*mItr).first << "] -- in container --> " << (*mItr).second << endreq; 193 } 194 } 195 196 } 197 198 // if an assembly was found 199 if ( !matchAssemblyIndexesMap.empty() ) { 200 map<int, int>::iterator mItr = matchAssemblyIndexesMap.begin(); 201 int totalClusterSize = 0; 202 for ( ; mItr != matchAssemblyIndexesMap.end() ; mItr++) { 203 // Mip segment index 204 int msI = (*mItr).second; 205 blob ms = blobsVector[msI]; 206 set< pair<Int_t, Int_t> > bc = ms.GetContentSet(); 207 set< pair<Int_t, Int_t> >::iterator bcI = bc.begin(); 208 209 for( ; bcI != bc.end() ; bcI++) { 210 //Log << MSG::INFO << GetMatrixElement(*bcI) << endreq; 211 m_assemblyTime.push_back( GetMatrixElement(*bcI) ); // saving time 212 } 213 // characteristics of the assembly 214 float alpha = ms.bP.rotAngle; 215 totalClusterSize += ms.bP.nPixels; 216 m_alphaAngle.push_back( alpha*180./TMath::Pi() ); 217 m_chi2.push_back( ms.bP.chisquare_OverDof ); 218 m_chi2Prob.push_back( TMath::Prob(ms.bP.chisquare, ms.bP.NDF)); 219 } 220 m_clusterSize.push_back( totalClusterSize ); 221 222 m_typeOfRecoFrame = __RECO_MIP; 223 } 224 else // fill it for all in the case of big clusters 225 { 226 // look at all blobs here 227 for(blobsItr = blobsVector.begin() ; blobsItr != blobsVector.end() ; blobsItr++) 228 { 229 set< pair<Int_t, Int_t> > bc = (*blobsItr).GetContentSet(); 230 if((int)bc.size() >= m_minNPixelsClouds){ 231 set< pair<Int_t, Int_t> >::iterator bcI = bc.begin(); 232 for( ; bcI != bc.end() ; bcI++){ 233 //Log << MSG::INFO << GetMatrixElement(*bcI) << endreq; 234 m_assemblyTime.push_back( GetMatrixElement(*bcI) ); // saving time 235 } 236 237 } 238 } 239 m_typeOfRecoFrame = __RECO_CLOUD; 146 240 } 147 241 … … 154 248 m_alphaAngle.clear(); 155 249 m_chi2.clear(); 250 m_chi2Prob.clear(); 251 m_assemblyTime.clear(); 156 252 157 253 } … … 169 265 */ 170 266 OctoClusterContainer::OctoClusterContainer(MediPixAlgo * algo) : 171 CandidateContainer(algo) {172 } 173 174 void OctoClusterContainer::SetBlobType(Int_t id, octoclustertype type){267 CandidateContainer(algo) { 268 } 269 270 void OctoClusterContainer::SetBlobType(Int_t /*id*/, octoclustertype /*type*/){ 175 271 //allBlobs[id].SetBlobType(type); 176 272 } -
mafalda/OctoCEA/OctoCEA.h
r248 r251 10 10 #define __HEAD_INDX 0 11 11 #define __TAIL_INDX 1 12 13 #define __RECO_UNDEFINED 0 14 #define __RECO_MIP 5 15 #define __RECO_CLOUD 10 12 16 13 17 class OctoCEA : public MediPixAlgo { … … 31 35 // Config 32 36 Int_t m_minNPixels; 37 Int_t m_minNPixelsClouds; 33 38 Int_t m_minClusterSize; 34 39 Float_t m_joinCutPixelTolerance; … … 39 44 vector<Float_t> m_alphaAngle; 40 45 vector<Float_t> m_chi2; 46 vector<Float_t> m_chi2Prob; 47 41 48 vector<Int_t> m_clusterSize; 49 Int_t m_typeOfRecoFrame; 50 51 vector<int> m_assemblyTime; 52 Int_t m_frameId; 42 53 43 54 ClassDef(OctoCEA, 1) -
mafalda/ShallowAngleFEIX/ShallowAngleFEIX.cpp
r249 r251 17 17 ShallowAngleFEIX::ShallowAngleFEIX() 18 18 : 19 m_minNPixels ( 5 ), 20 m_guardDistanceX ( 1 ), 21 m_guardDistanceY ( 5 ), 19 22 m_pixSizeX ( 0.40 ), // FEI3 [mm] 20 23 m_pixSizeY ( 0.05 ), // FEI3 [mm] 24 m_dRayBalSearch ( 1.4 ), 21 25 m_minXWidth ( 6 ), 22 m_guardDistanceX ( 1 ), 23 m_dRayBalSearch ( 1.4 ), 24 m_guardDistanceY ( 5 ), 25 m_minNPixels ( 5 ) 26 m_clCut ( 0.63 ) 26 27 { 27 28 … … 56 57 RegisterConfigurationValue(&m_pixSizeY, "pixelSizeY"); 57 58 RegisterConfigurationValue(&m_dRayBalSearch, "dRayBalSearch"); 59 RegisterConfigurationValue(&m_clCut, "CLCut"); 60 61 // Load clean map TH2F from file previously processed by WeightTOTMap 62 TString mapFileName = "ShallowAngleFEIX/MAFOutput_WeightTOTMap.root"; 63 m_cleanMapFile = new TFile(mapFileName, "OPEN"); 64 if(!m_cleanMapFile->IsOpen()){ 65 Log << MSG::ERROR << "Error opening good pixels (C.L.) map --> " << mapFileName << endreq; 66 Log << MSG::ERROR << "giving up ..." << endreq; 67 exit(1); 68 } 69 m_cleanMapFile->cd(); 70 m_cleanMap = static_cast<TH2F*>( m_cleanMapFile->Get("cutmap") ); 71 m_eqMap = static_cast<TH2F*>( m_cleanMapFile->Get("eqmap") ); 72 m_eqhistofunc = static_cast<TF1*>( m_cleanMapFile->Get( "eqhistofunc" ) ); 73 74 if( ! m_cleanMap || ! m_eqMap || ! m_eqhistofunc ) { 75 Log << MSG::ERROR << "Error opening good pixels histogram. Can't find one of more of the objects with name: " 76 << "cutmap, eqmap, eqhistofunc" << endreq; 77 Log << MSG::ERROR << "giving up ..." << endreq; 78 exit(1); 79 } 80 81 if ( Log.OutputLevel == MSG::DEBUG ) { 82 for(int x = 0 ; x < m_cleanMap->GetNbinsX() ; x++){ 83 for(int y = 0 ; y < m_cleanMap->GetNbinsY() ; y++){ 84 Log << MSG::DEBUG << TString::Format("%.1f ",m_cleanMap->GetBinContent(x, y)); 85 } 86 Log << MSG::DEBUG << endreq; 87 } 88 } 89 Log << MSG::INFO << "Eq mean = " << m_eqhistofunc->GetParameter(1) << endreq; 90 91 Log << MSG::INFO << "map loaded ..." << endreq; 92 93 // Performing any other operation on the algorithm's output file from now on 94 getMyROOTFile()->cd(); 58 95 59 96 } … … 76 113 vector<blob>::iterator blobsItr = blobsVector.begin(); //allBlobs.begin(); 77 114 78 79 115 for( ; blobsItr != blobsVector.end() ; blobsItr++) 80 116 { … … 93 129 94 130 if(bT == _MIP) { // only Mips 131 132 // initialize the mip goodness 133 m_mipGoodness = 0; 95 134 96 135 // info about the mip to store … … 182 221 << GetMatrixElement(*csItr) << endreq; 183 222 } 184 */223 */ 185 224 186 225 m_clusterHeight = (*blobsItr).GetBlobProperties().width_y; … … 188 227 int cntr = 0; 189 228 190 for(int xi = 0 ; xi <= 30 ; xi++){ 229 // Fill up with a few zeros to the maximum track size. 230 // All vectors should end up by at least one entry with value 0 231 for (int xi = 0 ; xi <= 30 ; xi++) { 191 232 m_totPerSegment.push_back(0.); // add segment initialized at 0 192 233 m_chargeWeights.push_back(0.); // add segment 193 234 } 194 235 195 for (int x = initx ; x <= endx ; x++){196 197 m_totPerSegment.push_back(0); // add segmentinitialized at 0198 m_chargeWeights.push_back(0); // add segment236 for (int x = initx ; x <= endx ; x++) { 237 238 m_totPerSegment.push_back(0); // add TOT entry initialized at 0 239 m_chargeWeights.push_back(0); // 199 240 200 241 for (int y = inity ; y <= endy ; y++) { 201 242 202 Log << MSG::DEBUG << " --> " << x << " , " << y << " : " << GetMatrixElement(x,y) << endreq; 243 if( m_cleanMap->GetBinContent(x, y) < m_clCut ) { // see if it passes the clCut 244 // in this case don't consider this mip 245 m_mipGoodness = 0; 246 } else { 247 m_mipGoodness = 1; 248 } 249 250 double correctedTOT = GetWeightedTOT(x, y); 251 Log << MSG::DEBUG << " --> " << x << " , " << y << " : " << GetMatrixElement(x,y) 252 << " | corrected : " << correctedTOT << endreq; 253 254 //m_totPerSegment[cntr] += correctedTOT; 255 //m_chargeWeights[cntr] += correctedTOT; // normalized later 203 256 m_totPerSegment[cntr] += GetMatrixElement(x,y); 204 257 m_chargeWeights[cntr] += GetMatrixElement(x,y); // normalized later … … 207 260 cntr++; 208 261 } 262 263 // analyze totPerSegment and chargeWeights see if some alignement is needed 264 // Compare the first entry with the mean of the rest of the track 265 int max = m_totPerSegment.size(), nent = 0; 266 float firsttot = m_totPerSegment[0], means = 0.; 267 // calc mean for the rest 268 for(cntr = 1 ; cntr < max ; cntr++) { 269 if(m_totPerSegment[cntr] == 0.) break; // end of track 270 means += m_totPerSegment[cntr]; 271 nent++; 272 } 273 means /= nent; 274 275 /* 276 if(firsttot > means*0.7) { // in this case the tracks needs shift 277 m_totPerSegment.insert(m_totPerSegment.begin(), 0.); 278 m_chargeWeights.insert(m_chargeWeights.begin(), 0.); 279 } 280 */ 209 281 210 282 // normalize m_chargeWeights to total charge … … 220 292 221 293 vector<Float_t>::iterator itrW = m_chargeWeights.begin(); 222 vector< Int_t>::iterator itrT = m_totPerSegment.begin();294 vector<Float_t>::iterator itrT = m_totPerSegment.begin(); 223 295 224 296 for( ; itrW != m_chargeWeights.end() ; ) { … … 245 317 246 318 // Fill the output tree of this algorithm 247 getMyTree()->Fill(); 248 319 if(m_mipGoodness) { 320 getMyTree()->Fill(); 321 } 322 //getMyTree()->Fill(); 249 323 // WARNING ! don't forget to clean up your variables for the next TTree::Fill call 250 324 m_distanceToCenter.clear(); … … 374 448 } 375 449 450 bool ShallowAngleFEIX::IsGoodPixel_CheckCL(pair<int, int> p, double cutCL){ 451 return IsGoodPixel_CheckCL(p.first, p.second, cutCL); 452 } 453 454 bool ShallowAngleFEIX::IsGoodPixel_CheckCL(int x, int y, double){ 455 456 if(m_cleanMap->GetBinContent(x, y) > 0.) { 457 return true; 458 } 459 return false; 460 } 461 462 double ShallowAngleFEIX::GetWeightedTOT(int x, int y){ 463 464 // Use the fit function m_eqhistofunc 465 // and the eqmap to find the weight value m_eqMap; 466 double binContent = m_eqMap->GetBinContent(x,y); 467 if(binContent == 0) // not present in the equalization map 468 return 0.; 469 470 double totval = (double)GetMatrixElement(x,y); 471 472 if (totval == 0.) // in case there is no hit in this location 473 return 0.; 474 475 double mean = m_eqhistofunc->GetParameter(1); // gaus mean 476 double fraction = binContent/mean; 477 478 return totval/fraction; // normalize to mean 479 } 480 376 481 #endif -
mafalda/ShallowAngleFEIX/ShallowAngleFEIX.h
r249 r251 32 32 Int_t GuessNumberOfDeltaRaysFromUnbalance(Int_t &, Int_t &); 33 33 int CheckDiscontinuity(blob, int); 34 bool IsGoodPixel_CheckCL(int, int, double); 35 bool IsGoodPixel_CheckCL(pair<int, int>, double); 36 double GetWeightedTOT(int, int); 34 37 35 38 private: … … 43 46 Float_t m_dRayBalSearch; 44 47 Int_t m_minXWidth; 48 Double_t m_clCut; 49 50 // tests 51 Int_t m_mipGoodness; 45 52 46 53 // for output … … 59 66 AllBlobsContainer * m_reclusteringContainer; 60 67 61 vector< Int_t> m_totPerSegment; // Total TOT per segment/pixel68 vector<Float_t> m_totPerSegment; // Total TOT per segment/pixel 62 69 vector<Float_t> m_chargeWeights; // Charge weight, normalized to the total TOT of the track 70 71 // clean map handling. Recover from WeightTOTMap run 72 TFile * m_cleanMapFile; 73 TH2F * m_cleanMap; 74 TH2F * m_eqMap; 75 TF1 * m_eqhistofunc; 63 76 64 77 ClassDef(ShallowAngleFEIX, 1) -
mafalda/ShallowAngleFEIX/configuration_algos_ShallowAngleFEIX.txt
r240 r251 11 11 PRBasicSpecies nInnerPixels 2 int 12 12 PRBasicSpecies longGammaMax 3 int 13 PRBasicSpecies minNPixelsMip 5int13 PRBasicSpecies minNPixelsMip 3 int 14 14 PRBasicSpecies maxNPixelsCurly 50 int 15 ShallowAngleFEIX minNPixels 5int16 ShallowAngleFEIX minXWidth 6int15 ShallowAngleFEIX minNPixels 3 int 16 ShallowAngleFEIX minXWidth 3 int 17 17 ShallowAngleFEIX guardDistanceX 1 int 18 18 ShallowAngleFEIX guardDistanceY 5 int -
mafalda/ShallowAngleFEIX/runAngle.C
r240 r251 14 14 } 15 15 16 #define __THICKNESS_PLANAR 0.200 // [mm] 17 #define __THICKNESS_3D 0.230 // [mm] 18 16 19 void runAngle(){ 17 20 18 gSystem->Load("/home/idarraga/analysis/root_tools/multipleplots/plots_treeTools.so"); 19 gROOT->ProcessLine(".x ~/styles/AtlasStyle.C"); 21 gSystem->Load("/home/idarraga/analysis/root_tools/multipleplots/plots_treeTools.so"); 22 gROOT->ProcessLine(".x ~/styles/AtlasStyle.C"); 23 24 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548.root", 25 "ShallowAngleFEIX", "61548 Planar-LUB4 1000V", 1.0); 26 27 // GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61564.root", 28 // "ShallowAngleFEIX", "61564 800V", 1.0); 29 30 // GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61566.root", 31 // "ShallowAngleFEIX", "61566 400V", 1.0); 32 33 // GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61569.root", 34 // "ShallowAngleFEIX", "61569 600V", 1.0); 35 36 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61573.root", 37 "ShallowAngleFEIX", "61573 200V", 1.0); 20 38 21 39 22 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_23_61417.root",23 "ShallowAngleFEIX", "61417 3D-SCC87 p-5E15", 1.0);40 //GetTree("/storage1/idarraga/Testbeam_September_CERN_2011/KEK_20V_200V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_21.root", 41 // "ShallowAngleFEIX", "DUT2", 1.0); 24 42 25 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548.root",26 "ShallowAngleFEIX", "61548 Planar-LUB4 n-5E15", 1.0);43 //GetTree("/storage1/idarraga/Testbeam_September_CERN_2011/KEK_20V_200V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_22.root", 44 // "ShallowAngleFEIX", "DUT3", 1.0); 27 45 28 //GetTree("/storage1/idarraga/Testbeam_September_CERN_2011/KEK_20V_200V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_21.root", 29 // "ShallowAngleFEIX", "DUT2", 1.0); 30 31 //GetTree("/storage1/idarraga/Testbeam_September_CERN_2011/KEK_20V_200V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_22.root", 32 // "ShallowAngleFEIX", "DUT3", 1.0); 33 34 /* 46 /* 35 47 GetTree("/storage1/idarraga/Testbeam_July_CERN_2011/KEK_100V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_22_100V.root", 36 48 "ShallowAngleFEIX", "DUT2", 1.0); … … 38 50 GetTree("/storage1/idarraga/Testbeam_July_CERN_2011/KEK_100V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_23_100V.root", 39 51 "ShallowAngleFEIX", "DUT3", 1.0); 40 */52 */ 41 53 42 43 44 45 46 47 48 49 50 opts.drawNormalized = false;54 ///////////////////////////////// 55 // config 56 OnCanvasOptions opts; 57 opts.doLegend = true; 58 opts.constructorStr = ""; 59 opts.drawOpt = ""; 60 opts.markerStyle = 3; 61 opts.setLogY = false; 62 opts.drawNormalized = true; 51 63 52 53 64 ActionFlags afl; 65 afl.doIntegral = false; 54 66 55 ////////////////////////////////// 56 // changes on style 57 TStyle * theStyle = (TStyle *)gROOT->FindObject("ATLAS"); 58 float tsize = 0.07; 59 theStyle->SetTextSize(tsize); 60 theStyle->SetLabelSize(tsize,"x"); 61 theStyle->SetTitleSize(tsize,"x"); 62 theStyle->SetLabelSize(tsize,"y"); 63 theStyle->SetTitleSize(tsize,"y"); 64 theStyle->SetLabelSize(tsize,"z"); 65 theStyle->SetTitleSize(tsize,"z"); 66 //////////////////////////////////////////////////// 67 68 TCanvas * c11 = new TCanvas("c11", "track multiplicity"); 67 ////////////////////////////////// 68 // changes on style 69 TStyle * theStyle = (TStyle *)gROOT->FindObject("ATLAS"); 70 float tsize = 0.07; 71 theStyle->SetTextSize(tsize); 72 theStyle->SetLabelSize(tsize,"x"); 73 theStyle->SetTitleSize(tsize,"x"); 74 theStyle->SetLabelSize(tsize,"y"); 75 theStyle->SetTitleSize(tsize,"y"); 76 theStyle->SetLabelSize(tsize,"z"); 77 theStyle->SetTitleSize(tsize,"z"); 78 //////////////////////////////////////////////////// 69 79 70 c11->cd(); 71 opts.doLegend = true; 72 opts.constructorStr = "(40,0,5)"; 73 TH1 * h_first = (TH1 *) DrawAll("mipLength_X", "clusterHeight < 3 && TMath::Abs(mipThetaAngle) < 0.17", opts, afl); 74 //h_first->GetXaxis()->SetRangeUser(0, 10); 75 h_first->GetXaxis()->SetTitle("mip length [mm]"); 80 TCanvas * c11 = new TCanvas("c11", "track multiplicity"); 76 81 82 c11->cd(); 83 opts.doLegend = true; 84 opts.constructorStr = "(40, 0.5, 3.0)"; 85 TH1 * h_first = (TH1 *) DrawAll("mipLength_X", "clusterHeight < 3 && TMath::Abs(mipThetaAngle) < 0.17", opts, afl); 86 //h_first->GetXaxis()->SetRangeUser(0, 10); 87 h_first->GetXaxis()->SetTitle("mip length [mm]"); 88 h_first->GetYaxis()->SetRangeUser(0, 1); 89 90 // angle function --> The limits here have to mach 91 TF1 * f1p = new TF1("anglefPlanar", getangle, 1, 10, 1); 92 f1p->SetParameter(0, __THICKNESS_PLANAR); // detector thickness 93 f1p->SetRange(f1p->Eval(3), f1p->Eval(1)); 94 95 //Double_t maxa = h_first->GetMaximum()*0.95; 96 Double_t maxa = 0.95; 97 TGaxis * ax2p = new TGaxis(1, maxa, 3, maxa, "anglefPlanar", 510, "-"); 98 ax2p->SetTitle("shallow angle planar [deg]"); 99 //ax2->SetLabelColor(kRed); 100 ax2p->Draw(""); 101 ax2p->SetLabelColor(kRed); 102 ax2p->SetLineColor(kRed); 103 ax2p->SetTitleColor(kRed); 104 105 106 /* 77 107 // angle function --> The limits here have to mach 78 TF1 * f1 = new TF1("anglef", getangle, 1.71836, 8.53077, 1); 79 f1->SetParameter(0, 0.150); // detector thickness 80 Double_t maxa = h_first->GetMaximum()*0.95; 81 TGaxis * ax2 = new TGaxis(1, maxa, 5, maxa, "anglef", 510, "-"); 82 ax2->SetTitle("shallow angle [deg]"); 108 TF1 * f13 = new TF1("anglef3D", getangle, 1, 10, 1); 109 f13->SetParameter(0, __THICKNESS_3D); // detector thickness 110 f13->SetRange(f13->Eval(3), f13->Eval(1)); 111 112 //Double_t maxa = h_first->GetMaximum()*0.75; 113 Double_t maxa = 0.75; 114 TGaxis * ax23 = new TGaxis(1, maxa, 3, maxa, "anglef3D", 510, "-"); 115 ax23->SetTitle("shallow angle 3D [deg]"); 83 116 //ax2->SetLabelColor(kRed); 84 ax2 ->Draw("");117 ax23->Draw(""); 85 118 86 cout << "1 mil = " << f1->Eval(1.) << " deg" << endl; 87 cout << "2.75 mil = " << f1->Eval(2.75) << " deg" << endl; 88 cout << "4 mil = " << f1->Eval(4.) << " deg" << endl; 89 cout << "5 mil = " << f1->Eval(5.) << " deg" << endl; 119 */ 90 120 91 c11->Update(); 121 cout << "1.0 mm, planar = " << f1p->Eval(1) << " deg" << endl; 122 //cout << "1.0 mm, 3d = " << f13->Eval(1) << " deg" << endl; 123 124 cout << "2.5 mm, planar = " << f1p->Eval(2.5) << " deg" << endl; 125 //cout << "2.5 mm, 3d = " << f13->Eval(2.5) << " deg" << endl; 126 127 cout << "5.0 mm, planar = " << f1p->Eval(5) << " deg" << endl; 128 //cout << "5.0 mm, 3d = " << f13->Eval(5) << " deg" << endl; 129 130 c11->Update(); 92 131 93 132 } -
mafalda/ShallowAngleFEIX/runClusterSize.C
r241 r251 12 12 13 13 14 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_2 3_61417.root",15 "ShallowAngleFEIX", " 61417 3D-SCC87 p-5E15", 1.0);14 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548.root", 15 "ShallowAngleFEIX", "LUB4_n-5E15_1000V", 1.0); 16 16 17 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548.root", 18 "ShallowAngleFEIX", "61548 Planar-LUB4 n-5E15", 1.0); 17 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61564.root", 18 "ShallowAngleFEIX", "LUB4_n-5E15_600V", 1.0); 19 20 GetTree("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61566.root", 21 "ShallowAngleFEIX", "LUB4_n-5E15_800V", 1.0); 19 22 20 23 //GetTree("/storage1/idarraga/Testbeam_September_CERN_2011/KEK_20V_200V_4deg/MAFOutput/MAFOutput_MPXNtuple_USBPIXI4_21.root", … … 58 61 //////////////////////////////////////////////////// 59 62 60 TCanvas * c11 = new TCanvas("c11", "cluster size ");63 TCanvas * c11 = new TCanvas("c11", "cluster size X"); 61 64 62 65 c11->cd(); … … 65 68 TH1 * h_first = (TH1 *) DrawAll("clusterSize_X","clusterHeight < 3 && TMath::Abs(mipThetaAngle) < 0.17", opts, afl); 66 69 //h_first->GetXaxis()->SetRangeUser(0, 10); 67 h_first->GetXaxis()->SetTitle("Number of sub-clusters in track"); 70 h_first->GetXaxis()->SetTitle("cluster size X [pixels]"); 71 72 73 TCanvas * c12 = new TCanvas("c12", "cluster size"); 74 c12->cd(); 75 opts.doLegend = true; 76 opts.constructorStr = "(30,0,3)"; //mipLength_X==7 && TMath::Abs(mipThetaAngle) < 0.17 77 TH1 * h_first = (TH1 *) DrawAll("mipLength","clusterHeight < 3 && TMath::Abs(mipThetaAngle) < 0.17", opts, afl); 78 //h_first->GetXaxis()->SetRangeUser(0, 10); 79 h_first->GetXaxis()->SetTitle("track length [mm]"); 80 68 81 69 82 c11->Update(); 83 c12->Update(); 84 70 85 71 86 } -
mafalda/ShallowAngleFEIX/runNewAlgo.C
r240 r251 6 6 //#define __THICKNESS 0.320 // [mm] KEK FE-I3 7 7 //#define __THICKNESS 0.150 // [mm] KEK FE-I4 run 50734 to 50744 8 #define __THICKNESS 0.250 // [mm] Lub4 run 61548 8 #define __THICKNESS_PLANAR 0.200 // [mm] Lub4 run 61548 9 #define __THICKNESS_3D 0.230 // [mm] SCC83 run 61417 9 10 10 11 #define __CHARGE 10 … … 17 18 TChain * T1 = new TChain("ShallowAngleFEIX"); 18 19 19 T1->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_23_61417.root"); 20 //T1->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548_weighted.root"); 21 T1->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548.root"); 20 22 TString titleT = ""; 21 23 … … 30 32 31 33 Int_t plotType = __CHARGE; 32 Int_t ndiv = 7;33 Int_t fulldiv = 7;34 Int_t ndiv = 5; 35 Int_t fulldiv = 5; 34 36 Int_t rangeYMax = 14; 35 37 36 38 TCanvas * c10 = new TCanvas(); 37 39 38 TGraphErrors * g1 = GetGraph(T1, " 3D", 7, 7, plotType);40 TGraphErrors * g1 = GetGraph(T1, "LUB4 - 1000V", 6, 6, plotType, __THICKNESS_PLANAR); 39 41 c10->cd(); 40 42 g1->Draw("A*"); … … 58 60 59 61 TChain * T2 = new TChain("ShallowAngleFEIX"); 60 T2->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61548.root"); 62 //T2->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61564_weighted.root"); 63 T2->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61564.root"); 61 64 //T2->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_AllPix_det_200_shallowAngle_3D.root"); 62 65 63 TGraphErrors * g2 = GetGraph(T2, " Planar", 6, 6, plotType);66 TGraphErrors * g2 = GetGraph(T2, "LUB4 600V", 6, 6, plotType, __THICKNESS_PLANAR); 64 67 // fix last point 65 68 c10->cd(); … … 68 71 g2->SetMarkerColor(kRed); 69 72 73 ///////////////////////////////////////////////////////////////////////////////////// 74 TChain * T3 = new TChain("ShallowAngleFEIX"); 75 //T3->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61566_weighted.root"); 76 T3->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61566.root"); 77 //T2->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_AllPix_det_200_shallowAngle_3D.root"); 78 TGraphErrors * g3 = GetGraph(T3, "LUB4 800V", 6, 6, plotType, __THICKNESS_PLANAR); 79 // fix last point 80 c10->cd(); 81 g3->Draw("*"); 82 g3->SetMarkerStyle(22); 83 g3->SetMarkerColor(kGreen); 84 85 /* 86 ///////////////////////////////////////////////////////////////////////////////////// 87 TChain * T4 = new TChain("ShallowAngleFEIX"); 88 T4->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_USBPIXI4_22_61573.root"); 89 //T2->Add("/home/idarraga/analysis/mafalda/MAFOutput_MPXNtuple_AllPix_det_200_shallowAngle_3D.root"); 90 TGraphErrors * g4 = GetGraph(T4, "LUB4 400V", 4, 4, plotType, __THICKNESS_PLANAR); 91 // fix last point 92 c10->cd(); 93 g4->Draw("*"); 94 g4->SetMarkerStyle(22); 95 g4->SetMarkerColor(kMagenta); 96 */ 70 97 71 98 ///////////////////////////////////////////////////////////////////////////////////// 72 99 TLegend * l1 = new TLegend(0.5, 0.7, 0.9, 0.9); 73 l1->AddEntry(g1, "61417 3D-SCC87 p-5E15", "P"); 74 l1->AddEntry(g2, "61548 Planar-LUB4 n-5E15", "P"); 100 l1->AddEntry(g1, "61548 LUB4 1000V", "P"); 101 l1->AddEntry(g2, "61564 LUB4 600V", "P"); 102 l1->AddEntry(g3, "61566 LUB4 800V", "P"); 103 //l1->AddEntry(g4, "61569 LUB4 400V", "P"); 75 104 l1->Draw(); 76 105 l1->SetBorderSize(1); … … 80 109 } 81 110 82 TGraphErrors * GetGraph(TChain * T, TString sufx, Int_t __NDIV, Int_t fullDiv, Int_t graphType ){111 TGraphErrors * GetGraph(TChain * T, TString sufx, Int_t __NDIV, Int_t fullDiv, Int_t graphType, Double_t thickness){ 83 112 84 113 gROOT->ProcessLine(".x ~/styles/AtlasStyle.C"); … … 106 135 TString wordDraw = ""; 107 136 TString histo = ""; 108 double partition = double( __THICKNESS)/double(fullDiv);137 double partition = double(thickness)/double(fullDiv); 109 138 110 139 int partitionCntr = 0; 111 //for (int indx = __NDIV-1 ; indx >= 0 ; indx--) {112 for (int indx = 0 ; indx < __NDIV ; indx++) {140 for (int indx = __NDIV-1 ; indx >= 0 ; indx--) { 141 //for (int indx = 0 ; indx < __NDIV ; indx++) { 113 142 114 143 wordDraw = "totPerSegment["; … … 128 157 c1->cd(indx+1); 129 158 TString cutS = "clusterHeight < 3 "; 130 cutS += " && clusterSize_X == ";159 cutS += " && (clusterSize_X == "; 131 160 cutS += __NDIV; 161 cutS += " || clusterSize_X == "; 162 cutS += __NDIV-1; 163 cutS += " )"; 132 164 cutS += " && TMath::Abs(mipThetaAngle) < 0.17"; // ~10 deg 133 165 TCut cutC = cutS; … … 202 234 return g; 203 235 } 236 237 //Float_t GetSegment(Float a)
Note: See TracChangeset
for help on using the changeset viewer.