Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:27

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // INCL++ intra-nuclear cascade model
0027 // Alain Boudard, CEA-Saclay, France
0028 // Joseph Cugnon, University of Liege, Belgium
0029 // Jean-Christophe David, CEA-Saclay, France
0030 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
0031 // Sylvie Leray, CEA-Saclay, France
0032 // Davide Mancusi, CEA-Saclay, France
0033 //
0034 #define INCLXX_IN_GEANT4_MODE 1
0035 
0036 #include "globals.hh"
0037 
0038 /** \file G4INCLHashing.hh
0039  * \brief Functions for hashing a collection of NucleonItems.
0040  *
0041  * \date 12th October 2012
0042  * \author Davide Mancusi
0043  */
0044 
0045 #ifndef G4INCLHASHING_HH_
0046 #define G4INCLHASHING_HH_
0047 
0048 #ifdef INCLXX_IN_GEANT4_MODE
0049 #define INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set 1
0050 #endif // INCLXX_IN_GEANT4_MODE
0051 
0052 #ifdef INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask
0053 
0054 #include <algorithm>
0055 #include <numeric>
0056 #include <climits>
0057 // #include <cassert>
0058 
0059 namespace G4INCL {
0060 
0061   namespace Hashing {
0062 
0063     typedef G4int NucleonItem;
0064 
0065     // the C++ standard guarantees that unsigned long is at least 32-bit long
0066     typedef unsigned long HashType;
0067 
0068     /* Depending on the size of the HashType type, we use 32-bit or 64-bit
0069      * binary masks. 64-bit masks guarantee lower collision rates (about a
0070      * factor of 3). Checks are done using compile-time constants defined in
0071      * the standard <climits> header.
0072      */
0073 
0074     namespace {
0075       const G4int maskTableSize = 500;
0076       HashType mask[maskTableSize] = {
0077 #if ULONG_MAX >= 18446744073709551615UL // 2^64-1
0078         // unsigned longs have at least 64 bits here
0079         4702504706864814267UL,
0080         15867743096752998125UL,
0081         1925133831785711339UL,
0082         3063678697824149615UL,
0083         3234475698548538313UL,
0084         7917662962824220875UL,
0085         9924018995951912525UL,
0086         4682901166658838314UL,
0087         981361508296534881UL,
0088         18376824469534567556UL,
0089         5343971687892173674UL,
0090         10169451505660710328UL,
0091         7865786236744900341UL,
0092         10279352445822536091UL,
0093         7089630702066408548UL,
0094         4808534960882600398UL,
0095         12538238618753707399UL,
0096         16091508301730012097UL,
0097         14073498192850855514UL,
0098         9966250765115558375UL,
0099         5718582854016674314UL,
0100         5837057680281951483UL,
0101         1596870119086046964UL,
0102         15866877264435719977UL,
0103         12743659579234384899UL,
0104         13589152059793213451UL,
0105         3364441792317801205UL,
0106         17190534087980602002UL,
0107         2252844317879582875UL,
0108         16883577324406774376UL,
0109         15985239218161130895UL,
0110         3661288085782215193UL,
0111         17294313791381397188UL,
0112         9405115097872546015UL,
0113         2834208340246893214UL,
0114         15589349083551097162UL,
0115         7475687940900359446UL,
0116         2706367355862311522UL,
0117         17987211229193808759UL,
0118         6863833750504706813UL,
0119         3685392250678121047UL,
0120         11759380240055300923UL,
0121         13403449794574083242UL,
0122         1985973959990096358UL,
0123         15223952677867744295UL,
0124         6118509595165778043UL,
0125         815155895778500187UL,
0126         18185573450595916074UL,
0127         5501350898920817482UL,
0128         382043392356382894UL,
0129         7212372096396984419UL,
0130         17216082813533838272UL,
0131         11664929762302443627UL,
0132         12742534429666211769UL,
0133         10885936672907243422UL,
0134         7408809357861601856UL,
0135         7235809803254354851UL,
0136         10923449527984005964UL,
0137         11846584293234382222UL,
0138         10656509822128626836UL,
0139         2129734486054336774UL,
0140         4595091378435214061UL,
0141         9874818728883580365UL,
0142         5946304945334907747UL,
0143         10039693308935676801UL,
0144         13281974385330546238UL,
0145         18100260506304059768UL,
0146         2874169620796400411UL,
0147         7108218580097801290UL,
0148         1609767302727070556UL,
0149         11296708194993589343UL,
0150         13937355006285948174UL,
0151         4714440178991372538UL,
0152         16551309706022489963UL,
0153         10000176812340548792UL,
0154         11878058786115320873UL,
0155         17227685596830233118UL,
0156         6913194524255335692UL,
0157         8581157771211862326UL,
0158         7692516248830269819UL,
0159         4834805303668841320UL,
0160         17683695285788382628UL,
0161         3163270552620053128UL,
0162         7501354178009882428UL,
0163         18032292064795682158UL,
0164         14903091228667847945UL,
0165         12658813769564311973UL,
0166         11071671991853641692UL,
0167         1898680911275368123UL,
0168         11850012838739454071UL,
0169         11605340059702017433UL,
0170         1993475538032240150UL,
0171         14225643076178260981UL,
0172         6073746146812460969UL,
0173         10427646200541715974UL,
0174         8534830515125041658UL,
0175         12137748989343460832UL,
0176         401619354176178507UL,
0177         10566842722928406433UL,
0178         2726007197202736953UL,
0179         12070986965363522186UL,
0180         14306741808513945796UL,
0181         9411600548893210409UL,
0182         10677814577847517837UL,
0183         2524629524427176799UL,
0184         13769537677295179355UL,
0185         2202164469715649820UL,
0186         18048299992904550974UL,
0187         11620367199819191275UL,
0188         12863789957300408274UL,
0189         9470331939464407385UL,
0190         1530202837192022943UL,
0191         8835064955139736011UL,
0192         8145200231008682998UL,
0193         7839809942742909916UL,
0194         9138434136821323472UL,
0195         14559393378324131957UL,
0196         17365140272468484867UL,
0197         12986052322695094991UL,
0198         15032117076709947810UL,
0199         3710476151324188272UL,
0200         1301282554894996635UL,
0201         10667152340954078766UL,
0202         6983777770664759713UL,
0203         16611664140947488647UL,
0204         12136122930610106551UL,
0205         15900825787656229127UL,
0206         10248132639811024681UL,
0207         11698219706208598358UL,
0208         12307261434875431124UL,
0209         14365082098869236341UL,
0210         7765033571440697089UL,
0211         14810290195054154855UL,
0212         9618298383970391972UL,
0213         5541541247731255102UL,
0214         16567733959804019203UL,
0215         17600930129818672877UL,
0216         5232016726685772558UL,
0217         226023602797856284UL,
0218         3268675878373668427UL,
0219         15412168229420758040UL,
0220         9483353024934253554UL,
0221         12957711733854877641UL,
0222         13202855362863795860UL,
0223         14659098127488639325UL,
0224         5642266569510167780UL,
0225         8405185641276686415UL,
0226         12567678120796482638UL,
0227         5572663458795121052UL,
0228         11292924459778654315UL,
0229         12907130784326268258UL,
0230         2781503111506861655UL,
0231         14052031913630628463UL,
0232         7662091316495917798UL,
0233         12388345726433231307UL,
0234         2855096782092770172UL,
0235         143760647337486211UL,
0236         5268378935483038729UL,
0237         14347085534022186031UL,
0238         8226804542313416051UL,
0239         503042565036387930UL,
0240         13277939264481364629UL,
0241         4807934385534294767UL,
0242         6554792055682376182UL,
0243         3505789456125861647UL,
0244         17485983928210687457UL,
0245         6551825177685364660UL,
0246         6530399878351375719UL,
0247         11618616536378075323UL,
0248         8710939588645435621UL,
0249         15913776342681996234UL,
0250         12975832615100357766UL,
0251         11385194348110364656UL,
0252         7334273726237402463UL,
0253         18215307287507846020UL,
0254         108052987233117093UL,
0255         14819872198639686030UL,
0256         7651108032227837181UL,
0257         7326148382022660565UL,
0258         15520843621422491193UL,
0259         14890169031248899249UL,
0260         3302880341533628710UL,
0261         17509231796729795392UL,
0262         6938974810266312299UL,
0263         9904104728819873047UL,
0264         10277854813228565819UL,
0265         8062859346560164933UL,
0266         11953220042241400520UL,
0267         8905905195342696566UL,
0268         8620925171331846539UL,
0269         15354008279539346333UL,
0270         16255477929425666651UL,
0271         15625465014312179739UL,
0272         6560194503171884780UL,
0273         458508474659358201UL,
0274         11178141379033004711UL,
0275         7025589002713530514UL,
0276         6196040542056180472UL,
0277         1771599404396005753UL,
0278         490848885681539136UL,
0279         15438702070227423706UL,
0280         8790555204480314499UL,
0281         6572556090639551862UL,
0282         3282457245646221158UL,
0283         4239195535437592000UL,
0284         16001734625059485025UL,
0285         14396081511655033925UL,
0286         10261432601192522025UL,
0287         9247260218125952769UL,
0288         16080570631414044686UL,
0289         15656989589485934942UL,
0290         10761254633620277391UL,
0291         1363122333823743651UL,
0292         14847079675279608117UL,
0293         6077849015756077442UL,
0294         15290828636077500470UL,
0295         220281240092237795UL,
0296         15760968530563963031UL,
0297         1364939791854189821UL,
0298         5997510653682588941UL,
0299         2006088633984038082UL,
0300         1383498232486134285UL,
0301         17859041093815211104UL,
0302         15894184107946313879UL,
0303         18173079296415961736UL,
0304         3443997055549483358UL,
0305         5294019672823936930UL,
0306         1341830676613088487UL,
0307         581727297735446503UL,
0308         18219577357392561487UL,
0309         17639313299012264080UL,
0310         14222133713791167321UL,
0311         5879505043799386532UL,
0312         7557129766625449226UL,
0313         13360075610958017985UL,
0314         12724115904336527780UL,
0315         16753075547920915484UL,
0316         4116411708112171871UL,
0317         16025692682808517910UL,
0318         4003328942103420939UL,
0319         9811320057930109787UL,
0320         3576072849789367484UL,
0321         17075748046009610792UL,
0322         12833406223291392866UL,
0323         9648248336540660688UL,
0324         17476583957989300837UL,
0325         16827359136787046510UL,
0326         4345039153564047180UL,
0327         1224716260729000059UL,
0328         13959598322342824445UL,
0329         10743140873520517726UL,
0330         13340880620026565045UL,
0331         9192556363923792986UL,
0332         3841907957831078749UL,
0333         246438482871824834UL,
0334         4260787342534664069UL,
0335         17100720253388227686UL,
0336         11544966922599678750UL,
0337         9293075407897592921UL,
0338         1610905992411273162UL,
0339         2239787421847352995UL,
0340         15182496755963432304UL,
0341         1823665993529743824UL,
0342         7263153004799849282UL,
0343         11497980475724160945UL,
0344         1274355111868335897UL,
0345         15057972526005432563UL,
0346         11823052640709049475UL,
0347         15927429045819933119UL,
0348         14618154733049321749UL,
0349         16861991482751749049UL,
0350         5936874228331837512UL,
0351         15290754097890487720UL,
0352         9191375772889979508UL,
0353         6816129633576113785UL,
0354         12923817606396645484UL,
0355         8875993281327238816UL,
0356         123714282527043508UL,
0357         7179882084825590703UL,
0358         3925024599322075567UL,
0359         2426048646574757412UL,
0360         10665962527629258587UL,
0361         12646312850531314143UL,
0362         528129165734836933UL,
0363         3701120955488573646UL,
0364         15861534485058814280UL,
0365         14022467189115595098UL,
0366         9502851142036471883UL,
0367         12432213096681522867UL,
0368         751500370320404802UL,
0369         1606345595406828785UL,
0370         10313713517508959984UL,
0371         6565609239876268324UL,
0372         8654149379457545096UL,
0373         6548830896464452248UL,
0374         1464368532414012445UL,
0375         4302937696445584032UL,
0376         17063664947863781419UL,
0377         8038577586991861682UL,
0378         10951259595021013980UL,
0379         7709630466255725074UL,
0380         609806407111517279UL,
0381         13860208046684354033UL,
0382         15140303568956907423UL,
0383         4803057729274452412UL,
0384         4367455766719288283UL,
0385         320027280359511727UL,
0386         16020877306388137190UL,
0387         3764882323315346488UL,
0388         11972546313392727283UL,
0389         7977601566213555124UL,
0390         15148378244947865280UL,
0391         4483722253329626321UL,
0392         16560836625841776840UL,
0393         14666077208671482135UL,
0394         9298193298119711211UL,
0395         12015014023744623893UL,
0396         10191703760489555596UL,
0397         1316913070589847725UL,
0398         15881746492947991011UL,
0399         13665807677473998048UL,
0400         14390309917106480591UL,
0401         17231567872468478469UL,
0402         4562957401728953232UL,
0403         11501454621029854493UL,
0404         10252134323451005656UL,
0405         12021948387925309670UL,
0406         3525149157835967069UL,
0407         10292558937206299109UL,
0408         13725724605985217856UL,
0409         175033751151696127UL,
0410         14720951489402332470UL,
0411         11927624343611332814UL,
0412         567437266624809204UL,
0413         14161392585443694227UL,
0414         8725463779420655722UL,
0415         12063468735510140344UL,
0416         12026523736635889408UL,
0417         16565599419781878456UL,
0418         7086470817660744490UL,
0419         14809513609573064984UL,
0420         10898762682820885052UL,
0421         13982083571459739493UL,
0422         15656618354974864372UL,
0423         4239583100143107224UL,
0424         4322769551545487304UL,
0425         13825585217369415084UL,
0426         5136324433139686016UL,
0427         8179080547263771206UL,
0428         8279259187088296150UL,
0429         6381371846375303738UL,
0430         3142014871877744388UL,
0431         3417815453103862427UL,
0432         5556557018553548625UL,
0433         7788492627093668219UL,
0434         2446537327809742760UL,
0435         7165731799178534002UL,
0436         10969060298437286606UL,
0437         16392640790529049402UL,
0438         4905600830298563047UL,
0439         12442106640046578583UL,
0440         7139041375816724964UL,
0441         18098103947732186633UL,
0442         2078238351823174321UL,
0443         9929562085097862277UL,
0444         14231090695955652612UL,
0445         16914810114016502414UL,
0446         9172887937989634160UL,
0447         10057184693043820912UL,
0448         8739867056556181319UL,
0449         1879322488574672564UL,
0450         6706469496298082633UL,
0451         17962793280504692541UL,
0452         2796622365685518391UL,
0453         14206454203780509608UL,
0454         11911505185092294091UL,
0455         13188421404411005493UL,
0456         1002631262698104372UL,
0457         16116424222649594941UL,
0458         731059841323644991UL,
0459         16630196285890835221UL,
0460         6275370517569960592UL,
0461         2762335813606797964UL,
0462         1550415195017045798UL,
0463         8084777285994689863UL,
0464         4858045103923411134UL,
0465         13517076072140006105UL,
0466         16656029182431041189UL,
0467         6076064496187725305UL,
0468         15281271591975529160UL,
0469         2275428871306187428UL,
0470         15396744606475751109UL,
0471         15460778948302864604UL,
0472         6107847787338713474UL,
0473         9357621545767658217UL,
0474         4805014239018879550UL,
0475         17869119773972988965UL,
0476         17868495682315323441UL,
0477         10660808254721474616UL,
0478         7308276872489783138UL,
0479         4234856545479982050UL,
0480         1223334879029033304UL,
0481         10995800624761949288UL,
0482         16283797325974965665UL,
0483         12410167362078398820UL,
0484         12918484557456873081UL,
0485         14423314551522087679UL,
0486         4967867692111402622UL,
0487         16197846038770304940UL,
0488         11809884480603742831UL,
0489         16802686488973843640UL,
0490         2354077987008574056UL,
0491         9978003576519895777UL,
0492         5506048811554826358UL,
0493         18433781523380564149UL,
0494         4302137793340917657UL,
0495         978195094879846769UL,
0496         2377823329880292548UL,
0497         3464291122006072777UL,
0498         18046845603455616162UL,
0499         13944776942598500463UL,
0500         4000590694056817931UL,
0501         496833875371241644UL,
0502         16247695245933522501UL,
0503         1505779951058046438UL,
0504         11430822963532124358UL,
0505         4729903064888922231UL,
0506         8864507718425611027UL,
0507         14643598183997536338UL,
0508         4480511581250357378UL,
0509         11133239898726463704UL,
0510         17471052555928421508UL,
0511         15541989708583753235UL,
0512         7461560065837635158UL,
0513         13956421526574063689UL,
0514         3743280538841219763UL,
0515         12020611143801404565UL,
0516         6618703997501212010UL,
0517         3729371474666129836UL,
0518         17869245751809494685UL,
0519         1833331385744685838UL,
0520         1506104207003999508UL,
0521         8158509169843256229UL,
0522         10212507222875597491UL,
0523         7211593336579637715UL,
0524         14341253648497092530UL,
0525         4511202703905924031UL,
0526         8043833010361144102UL,
0527         2512875450160943286UL,
0528         18235665817864664213UL,
0529         8317446467730476132UL,
0530         11182884000969346056UL,
0531         548357546399462395UL,
0532         1960628024952592835UL,
0533         4650095513901192085UL,
0534         12679676177772217157UL,
0535         3487733703240934135UL,
0536         6446640077094538365UL,
0537         1114715573562175630UL,
0538         16622874083185883281UL,
0539         17081932748524927392UL,
0540         17192402071367355968UL,
0541         15013800339030843048UL,
0542         3718961432784285989UL,
0543         14953817216655866296UL,
0544         11410118254031919487UL,
0545         17718071771819733200UL,
0546         6970769915355275987UL,
0547         14244261541942962860UL,
0548         295778071941084510UL,
0549         553041658124347434UL,
0550         571128341496031343UL,
0551         6867891970504820807UL,
0552         16515587447694198371UL,
0553         3932569386063656416UL,
0554         15542525920467376967UL,
0555         4513384432419818675UL,
0556         7336705434792969335UL,
0557         1342984449178439078UL,
0558         10672151960711459277UL,
0559         11668091039787926587UL,
0560         15308742994910314323UL,
0561         8337161158579684228UL,
0562         5390473811288298369UL,
0563         444117188512458090UL,
0564         8602531868090961223UL,
0565         1632809043568697774UL,
0566         11829254858211213981UL,
0567         4634227867572760505UL,
0568         16086237486731074061UL,
0569         4844172753138751369UL,
0570         4992022238300904271UL,
0571         11132360655811360102UL,
0572         11660714643785469458UL,
0573         2468480999090126185UL,
0574         10912054708474512716UL,
0575         12659667168896228555UL,
0576         11988368921832936489UL,
0577         5116996783249524791UL,
0578         253818271896405507UL
0579 #else // ULONG_MAX >= 18446744073709551615
0580           // unsigned longs have less than 64 bits here
0581           4218046471UL,
0582         1917139952UL,
0583         2103556369UL,
0584         1588695878UL,
0585         4215491346UL,
0586         216507845UL,
0587         2296134958UL,
0588         1868314761UL,
0589         3228779327UL,
0590         1785085484UL,
0591         4228225705UL,
0592         1165369009UL,
0593         3142089765UL,
0594         431503981UL,
0595         3369606777UL,
0596         745480828UL,
0597         2744780773UL,
0598         689045082UL,
0599         1900506313UL,
0600         2497498204UL,
0601         368683604UL,
0602         2225005389UL,
0603         781333974UL,
0604         4132002528UL,
0605         2847677322UL,
0606         343783736UL,
0607         2901322050UL,
0608         3337243677UL,
0609         1665993590UL,
0610         233599841UL,
0611         1022462535UL,
0612         1680112766UL,
0613         500144658UL,
0614         3013714463UL,
0615         1102944137UL,
0616         424404167UL,
0617         1616048503UL,
0618         3058072676UL,
0619         2626558419UL,
0620         2270217197UL,
0621         1042360030UL,
0622         1406615072UL,
0623         2817651072UL,
0624         3066388841UL,
0625         3595996753UL,
0626         2530300747UL,
0627         1068533293UL,
0628         3850615434UL,
0629         2000952241UL,
0630         500251219UL,
0631         2785863467UL,
0632         116749905UL,
0633         2534901578UL,
0634         2762569636UL,
0635         441176494UL,
0636         3611264136UL,
0637         708254627UL,
0638         3107133154UL,
0639         3498823450UL,
0640         3710248321UL,
0641         3408201403UL,
0642         2483680087UL,
0643         1593406496UL,
0644         2358632005UL,
0645         1113775647UL,
0646         1296788200UL,
0647         866750108UL,
0648         1511795181UL,
0649         2007682240UL,
0650         1383572622UL,
0651         2747177348UL,
0652         751086457UL,
0653         3862498228UL,
0654         1330825518UL,
0655         1893848486UL,
0656         3716728436UL,
0657         257714096UL,
0658         1129572537UL,
0659         3411765329UL,
0660         1445308638UL,
0661         1675128925UL,
0662         1177771214UL,
0663         610662193UL,
0664         308703855UL,
0665         3766028156UL,
0666         2406778266UL,
0667         1614133721UL,
0668         3094138658UL,
0669         644181699UL,
0670         3585820756UL,
0671         228354647UL,
0672         3895845225UL,
0673         837654579UL,
0674         2423338235UL,
0675         3626844735UL,
0676         4004795529UL,
0677         1966777404UL,
0678         4099992662UL,
0679         561993057UL,
0680         478026097UL,
0681         2726060916UL,
0682         160900471UL,
0683         4067242522UL,
0684         2107667107UL,
0685         2291883857UL,
0686         3366222014UL,
0687         804030225UL,
0688         815232690UL,
0689         4173469665UL,
0690         3680594736UL,
0691         1812916838UL,
0692         953829049UL,
0693         645064420UL,
0694         893103776UL,
0695         1484445384UL,
0696         1704310224UL,
0697         3169988691UL,
0698         994674462UL,
0699         3348302238UL,
0700         420911742UL,
0701         3997852732UL,
0702         3006569532UL,
0703         244288857UL,
0704         3012303255UL,
0705         3091414730UL,
0706         3919806716UL,
0707         815658776UL,
0708         396540369UL,
0709         2296675021UL,
0710         3199014033UL,
0711         2569108436UL,
0712         3862344457UL,
0713         4058338881UL,
0714         1161706542UL,
0715         2972997031UL,
0716         2099532487UL,
0717         160888949UL,
0718         427549488UL,
0719         3061518659UL,
0720         66373532UL,
0721         3444886884UL,
0722         2530414305UL,
0723         3380064368UL,
0724         937051782UL,
0725         1302891919UL,
0726         2463653477UL,
0727         3547879633UL,
0728         2260320717UL,
0729         832678359UL,
0730         2453616965UL,
0731         2193052461UL,
0732         799622604UL,
0733         3629014225UL,
0734         1522933084UL,
0735         2498150583UL,
0736         1976833008UL,
0737         1725662928UL,
0738         1733324678UL,
0739         3374380020UL,
0740         818903650UL,
0741         718472891UL,
0742         411252729UL,
0743         3187730653UL,
0744         798673927UL,
0745         1222802842UL,
0746         1985038219UL,
0747         1623995355UL,
0748         2603784033UL,
0749         4261727525UL,
0750         3939193905UL,
0751         2256923068UL,
0752         507372076UL,
0753         229897092UL,
0754         3447212333UL,
0755         1015331998UL,
0756         1624914646UL,
0757         3270616777UL,
0758         1922996004UL,
0759         2303929294UL,
0760         3083527264UL,
0761         3511924852UL,
0762         651582997UL,
0763         2830297570UL,
0764         2541981492UL,
0765         3229134142UL,
0766         535111766UL,
0767         2531439891UL,
0768         1176474835UL,
0769         1746643607UL,
0770         196953906UL,
0771         190859135UL,
0772         1471944757UL,
0773         3764050027UL,
0774         2300961517UL,
0775         1200836119UL,
0776         1934885757UL,
0777         1017153529UL,
0778         864626426UL,
0779         65215191UL,
0780         3649915955UL,
0781         2649000649UL,
0782         3056185941UL,
0783         2895789221UL,
0784         2705123786UL,
0785         3486894128UL,
0786         1764275188UL,
0787         800856520UL,
0788         1121637219UL,
0789         3470689154UL,
0790         2031015368UL,
0791         1799564405UL,
0792         412027838UL,
0793         3505785501UL,
0794         819633830UL,
0795         2841515279UL,
0796         397789381UL,
0797         3850545068UL,
0798         4038096561UL,
0799         702453020UL,
0800         298184560UL,
0801         1331143206UL,
0802         3832472400UL,
0803         483752162UL,
0804         3365506546UL,
0805         2403178818UL,
0806         2588604760UL,
0807         3630868707UL,
0808         2672754775UL,
0809         3834743541UL,
0810         625254315UL,
0811         3404805826UL,
0812         2758773926UL,
0813         3539158313UL,
0814         1304746437UL,
0815         4228336097UL,
0816         1790470857UL,
0817         2017211747UL,
0818         2823780770UL,
0819         1361022238UL,
0820         2442638132UL,
0821         3465700788UL,
0822         2602256049UL,
0823         61072285UL,
0824         1290754848UL,
0825         1365538365UL,
0826         2885926246UL,
0827         3366937675UL,
0828         1976271220UL,
0829         4274857987UL,
0830         2846551234UL,
0831         3730952612UL,
0832         785655762UL,
0833         2640747064UL,
0834         2479569674UL,
0835         2988213501UL,
0836         238402214UL,
0837         2736968438UL,
0838         1273211556UL,
0839         2993298676UL,
0840         2076907296UL,
0841         169664466UL,
0842         3590743418UL,
0843         2853715414UL,
0844         1494116982UL,
0845         3408636076UL,
0846         1354085945UL,
0847         2121174096UL,
0848         557203192UL,
0849         2005947221UL,
0850         2790204730UL,
0851         3673048078UL,
0852         2710286579UL,
0853         2759941695UL,
0854         2554805430UL,
0855         1565053908UL,
0856         1516728908UL,
0857         457211737UL,
0858         4053842378UL,
0859         1926452932UL,
0860         121166907UL,
0861         1884552326UL,
0862         2050083102UL,
0863         783329973UL,
0864         1002934724UL,
0865         2916755028UL,
0866         1574390275UL,
0867         4246041184UL,
0868         112940213UL,
0869         4213344814UL,
0870         3831377539UL,
0871         3593710048UL,
0872         184196123UL,
0873         62388243UL,
0874         1824724968UL,
0875         1553056630UL,
0876         2471314862UL,
0877         1580248726UL,
0878         1641907471UL,
0879         4182117804UL,
0880         244827601UL,
0881         2673787044UL,
0882         1245428424UL,
0883         1254024234UL,
0884         1944146503UL,
0885         2068525708UL,
0886         1452126855UL,
0887         1368763640UL,
0888         2063660828UL,
0889         306042674UL,
0890         668216774UL,
0891         2002594576UL,
0892         3192370193UL,
0893         4189750176UL,
0894         1815590529UL,
0895         2838559664UL,
0896         3322933511UL,
0897         708460425UL,
0898         3093499804UL,
0899         219970021UL,
0900         2136064297UL,
0901         1281979964UL,
0902         3437613761UL,
0903         544003806UL,
0904         2998811936UL,
0905         1481470929UL,
0906         2880899873UL,
0907         3617899122UL,
0908         2269535287UL,
0909         2964733041UL,
0910         1437018425UL,
0911         4136436935UL,
0912         2892386937UL,
0913         2312588208UL,
0914         3470825412UL,
0915         3048839250UL,
0916         3124535567UL,
0917         74106735UL,
0918         740534715UL,
0919         780483498UL,
0920         1703009387UL,
0921         3908417545UL,
0922         2925498568UL,
0923         570244170UL,
0924         768611579UL,
0925         2561901277UL,
0926         3369289022UL,
0927         298430172UL,
0928         3399976658UL,
0929         2781253163UL,
0930         2203229433UL,
0931         4083764265UL,
0932         1813739940UL,
0933         2495956219UL,
0934         1733876904UL,
0935         2961522297UL,
0936         2806638528UL,
0937         210215678UL,
0938         3179651913UL,
0939         3488143624UL,
0940         2162063032UL,
0941         2230441611UL,
0942         3104777333UL,
0943         1901009578UL,
0944         2357529595UL,
0945         1661659881UL,
0946         2275001257UL,
0947         1089779619UL,
0948         1019581619UL,
0949         3676689000UL,
0950         2363224232UL,
0951         3087179246UL,
0952         2521585396UL,
0953         1172580989UL,
0954         3363959227UL,
0955         1379171244UL,
0956         2568664929UL,
0957         2716951910UL,
0958         634711458UL,
0959         1881366407UL,
0960         2339310622UL,
0961         1437137856UL,
0962         775517573UL,
0963         2403816337UL,
0964         3643691625UL,
0965         2796142813UL,
0966         2636271743UL,
0967         3548645335UL,
0968         2401818065UL,
0969         1430955355UL,
0970         1529261488UL,
0971         2672050975UL,
0972         1824816344UL,
0973         437321422UL,
0974         1010469737UL,
0975         975873927UL,
0976         3808619211UL,
0977         1306922849UL,
0978         2306306586UL,
0979         3492263153UL,
0980         915764428UL,
0981         4049080639UL,
0982         2584666827UL,
0983         2248503228UL,
0984         1156685342UL,
0985         3545089377UL,
0986         2927987815UL,
0987         1188340469UL,
0988         1983809416UL,
0989         2359080396UL,
0990         3026745995UL,
0991         1020085481UL,
0992         2455748822UL,
0993         2973731428UL,
0994         1685598150UL,
0995         2459914554UL,
0996         222412187UL,
0997         1550326895UL,
0998         3808681066UL,
0999         910364646UL,
1000         4011483211UL,
1001         3449464402UL,
1002         3094973082UL,
1003         3370230650UL,
1004         1693151952UL,
1005         3574854040UL,
1006         3557103099UL,
1007         4108399894UL,
1008         3762036621UL,
1009         2337346271UL,
1010         1005455572UL,
1011         3860207735UL,
1012         1771002576UL,
1013         199004943UL,
1014         1578846676UL,
1015         2676995104UL,
1016         4076948954UL,
1017         830057378UL,
1018         459065499UL,
1019         3804368733UL,
1020         3499868406UL,
1021         852696530UL,
1022         514613423UL,
1023         1584281952UL,
1024         985799155UL,
1025         1895009366UL,
1026         3825253357UL,
1027         1782693174UL,
1028         2196979238UL,
1029         1308429445UL,
1030         2960767408UL,
1031         2285337396UL,
1032         2065293874UL,
1033         1306724979UL,
1034         4056398081UL,
1035         4047112430UL,
1036         3606840914UL,
1037         3117829644UL,
1038         3877872838UL,
1039         3297977849UL,
1040         336255855UL,
1041         3794593369UL,
1042         2534532716UL,
1043         3726226824UL,
1044         2067902083UL,
1045         1289138711UL,
1046         615241845UL,
1047         3711156810UL,
1048         4069284324UL,
1049         3829237942UL,
1050         3615667378UL,
1051         750506440UL,
1052         3851304132UL,
1053         1159089146UL,
1054         2459260597UL,
1055         2955574874UL,
1056         1775846339UL,
1057         1872505027UL,
1058         3021810567UL,
1059         2498812392UL,
1060         2388439890UL,
1061         3509540924UL,
1062         4132084900UL,
1063         1762358900UL,
1064         3005639020UL,
1065         961559514UL,
1066         5499771UL,
1067         2114442568UL,
1068         2725996306UL,
1069         2213448586UL,
1070         3041192141UL,
1071         2318358424UL,
1072         4199956637UL,
1073         508024672UL,
1074         2898231491UL,
1075         985807031UL,
1076         3712119117UL,
1077         487464412UL,
1078         1443950379UL,
1079         2897942828UL,
1080         2942321529UL
1081 #endif
1082       };
1083 
1084       /// \brief Helper function for hashing
1085       inline HashType xorrer(HashType const &l, NucleonItem const &r) {
1086         return l^mask[r];
1087       }
1088 
1089     }
1090 
1091     /** \brief Compute the hash of a nucleon configuration
1092      *
1093      * The hash is computed as
1094      *
1095      *   \f[ \mathrm{mask}_{i_1} \oplus \mathrm{mask}_{i_2} \oplus \ldots \oplus \mathrm{mask}_{i_n} \f]
1096      *
1097      * where \f$\oplus\f$ represents logical exclusive OR (XOR), \f$i_1,\ldots,
1098      * i_n\f$ represent the indices of the nucleons in the
1099      * ClusteringModelIntercomparison::consideredPartners
1100      * array, and \f$\mathrm{mask}_i\f$ is a static look-up table of 500
1101      * \f$n\f$-bit integers such that their binary representations have exactly
1102      * \f$n/2\f$ true bits and \f$n/2\f$ false bits, at random positions. The
1103      * value of \f$n\f$ is 32 if unsigned longs are less than 64-bit wide, and
1104      * 64 otherwise.
1105      *
1106      * Folding the mask values using XOR has two advantages: first, XOR is a
1107      * commutative operation, so the result is independent of the order in
1108      * which the nucleons appear in the configuration (which is what we want).
1109      * Second, it's very fast. Profiling shows that the time spent hashing
1110      * configurations is negligible compared to the time spent evaluating
1111      * phase-space proximity.
1112      */
1113     inline HashType hashConfig(NucleonItem *config, G4int n) {
1114 // assert(n<maskTableSize);
1115       return std::accumulate(config, config+n, ((HashType)0), xorrer);
1116     }
1117 
1118   }
1119 }
1120 
1121 #endif // INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask
1122 
1123 #endif // G4INCLHASHING_HH_